diff options
author | Michael Bestas <mikeioannina@gmail.com> | 2014-10-24 11:26:25 +0300 |
---|---|---|
committer | Chippa-a <vusal1372@gmail.com> | 2019-10-25 15:55:25 +0300 |
commit | 6ab4abaeba483e1badd41c92034f868578016fdc (patch) | |
tree | 2ccdcc5e3fa7788fd1e33dbdd66ea1b4ec75abec | |
parent | a54fd8a26cde86b0be36c423ec1d1d0ab2d4bd92 (diff) | |
download | android_packages_apps_Snap-6ab4abaeba483e1badd41c92034f868578016fdc.tar.gz android_packages_apps_Snap-6ab4abaeba483e1badd41c92034f868578016fdc.tar.bz2 android_packages_apps_Snap-6ab4abaeba483e1badd41c92034f868578016fdc.zip |
Camera2: Remove CAF video duration code
Change-Id: I583e212f3c43a5ddf80fdb16557b3ddd9e3161c2
Signed-off-by: Chippa-a <vusal1372@gmail.com>
-rw-r--r--[-rwxr-xr-x] | res/values-zh-rCN/strings.xml | 2 | ||||
-rwxr-xr-x | res/values/camera2arrays.xml | 19 | ||||
-rwxr-xr-x | res/values/qcomarrays.xml | 16 | ||||
-rwxr-xr-x | res/values/qcomstrings.xml | 13 | ||||
-rwxr-xr-x | res/xml/capture_preferences.xml | 8 | ||||
-rwxr-xr-x | res/xml/setting_menu_preferences.xml | 10 | ||||
-rwxr-xr-x | res/xml/video_preferences.xml | 7 | ||||
-rwxr-xr-x | src/com/android/camera/CameraSettings.java | 20 | ||||
-rwxr-xr-x | src/com/android/camera/CaptureModule.java | 4 | ||||
-rwxr-xr-x | src/com/android/camera/SettingsActivity.java | 15 | ||||
-rwxr-xr-x | src/com/android/camera/SettingsManager.java | 58 | ||||
-rw-r--r-- | src/com/android/camera/VideoMenu.java | 2 | ||||
-rw-r--r-- | src/com/android/camera/VideoModule.java | 18 |
13 files changed, 4 insertions, 188 deletions
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index e7b67847a..e7872f5fe 100755..100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -414,8 +414,6 @@ <string name="pref_camera_video_duration_entry_mms">"30 秒(MMS)"</string> <string name="pref_camera_video_duration_entry_10">"10 分钟"</string> <string name="pref_camera_video_duration_entry_30">"30 分钟"</string> - <string name="pref_camera_video_duration_entry_48">"48 分钟"</string> - <string name="pref_camera_video_duration_entry_144">"144 分钟"</string> <string name="pref_camera_video_duration_entry_nolimit">"无限制"</string> <!-- Settings screen, Select hfr title --> diff --git a/res/values/camera2arrays.xml b/res/values/camera2arrays.xml index 921303120..f28b2d682 100755 --- a/res/values/camera2arrays.xml +++ b/res/values/camera2arrays.xml @@ -746,25 +746,6 @@ <item>320x240</item> </string-array> - <string-array name="pref_camera2_video_duration_entries" translatable="false"> - <item>@string/pref_camera_video_duration_entry_mms</item> - <item>@string/pref_camera_video_duration_entry_10</item> - <item>@string/pref_camera_video_duration_entry_30</item> - <item>@string/pref_camera_video_duration_entry_48</item> - <item>@string/pref_camera_video_duration_entry_144</item> - <item>@string/pref_camera_video_duration_entry_nolimit</item> - </string-array> - - <!-- The numbers are in minutes, except -1 means the duration suitable for mms. --> - <string-array name="pref_camera2_video_duration_entryvalues" translatable="false"> - <item>-1</item> - <item>10</item> - <item>30</item> - <item>48</item> - <item>144</item> - <item>0</item> - </string-array> - <string-array name="pref_camera2_videoencoder_entries" translatable="false"> <item>@string/pref_camera_videoencoder_entry_0</item> <item>@string/pref_camera_videoencoder_entry_1</item> diff --git a/res/values/qcomarrays.xml b/res/values/qcomarrays.xml index 53b2ba7d1..83d52b57c 100755 --- a/res/values/qcomarrays.xml +++ b/res/values/qcomarrays.xml @@ -574,22 +574,6 @@ <item>aac</item> </string-array> - <!-- Camera Preferences Video Duration dialog box entries --> - <string-array name="pref_camera_video_duration_entries" translatable="false"> - <item>@string/pref_camera_video_duration_entry_mms</item> - <item>@string/pref_camera_video_duration_entry_10</item> - <item>@string/pref_camera_video_duration_entry_30</item> - <item>@string/pref_camera_video_duration_entry_nolimit</item> - </string-array> - - <!-- The numbers are in minutes, except -1 means the duration suitable for mms. --> - <string-array name="pref_camera_video_duration_entryvalues" translatable="false"> - <item>-1</item> - <item>10</item> - <item>30</item> - <item>0</item> - </string-array> - <!-- Camera Preferences Skin Tone Enhancement dialog box entries --> <string-array name="pref_camera_skinToneEnhancement_entries"> <item>@string/pref_camera_skinToneEnhancement_entry_enable</item> diff --git a/res/values/qcomstrings.xml b/res/values/qcomstrings.xml index f097e4739..744281ea0 100755 --- a/res/values/qcomstrings.xml +++ b/res/values/qcomstrings.xml @@ -81,19 +81,6 @@ <!-- Settings screen, Audio encoder dialog radio button choices --> <string name="pref_camera_audioencoder_entry_0">AMRNB</string> <string name="pref_camera_audioencoder_entry_1">AAC</string> - <!-- Default video duration setting. A numerical value.--> - <string name="pref_camera_video_duration_default" translatable="false">10</string> - - <!-- Settings screen, Video duration title --> - <string name="pref_camera_video_duration_title">Video duration</string> - - <!-- Settings screen, Video duration dialog radio button choices --> - <string name="pref_camera_video_duration_entry_mms">30 seconds(MMS)</string> - <string name="pref_camera_video_duration_entry_10">10 minutes</string> - <string name="pref_camera_video_duration_entry_30">30 minutes</string> - <string name="pref_camera_video_duration_entry_48">48 minutes</string> - <string name="pref_camera_video_duration_entry_144">144 minutes</string> - <string name="pref_camera_video_duration_entry_nolimit">no limit</string> <!-- Default Skin Tone Enhancement setting. Do not translate. --> <string name="pref_camera_skinToneEnhancement_default">disable</string> diff --git a/res/xml/capture_preferences.xml b/res/xml/capture_preferences.xml index 51002729e..782a8001d 100755 --- a/res/xml/capture_preferences.xml +++ b/res/xml/capture_preferences.xml @@ -220,14 +220,6 @@ camera:singleIcon="@drawable/ic_settings_quality" camera:title="@string/pref_video_quality_title"/> - <IconListPreference - camera:defaultValue="@string/pref_camera_video_duration_default" - camera:entries="@array/pref_camera2_video_duration_entries" - camera:entryValues="@array/pref_camera2_video_duration_entryvalues" - camera:key="pref_camera2_video_duration_key" - camera:singleIcon="@drawable/ic_settings_duration" - camera:title="@string/pref_camera_video_duration_title"/> - <ListPreference camera:defaultValue="@string/pref_camera_videoencoder_default" camera:entries="@array/pref_camera2_videoencoder_entries" diff --git a/res/xml/setting_menu_preferences.xml b/res/xml/setting_menu_preferences.xml index da0a21154..51b858947 100755 --- a/res/xml/setting_menu_preferences.xml +++ b/res/xml/setting_menu_preferences.xml @@ -189,16 +189,6 @@ android:summary="%s" android:title="@string/pref_video_quality_title" /> - <ListPreference - android:defaultValue="@string/pref_camera_video_duration_default" - android:entries="@array/pref_camera2_video_duration_entries" - android:entryValues="@array/pref_camera2_video_duration_entryvalues" - android:icon="@drawable/video_duration" - android:key="pref_camera2_video_duration_key" - android:layout="@layout/preference" - android:summary="%s" - android:title="@string/pref_camera_video_duration_title" /> - <SwitchPreference android:defaultValue="false" android:icon="@drawable/image_stabilization" diff --git a/res/xml/video_preferences.xml b/res/xml/video_preferences.xml index 66e2e0524..1d2917360 100755 --- a/res/xml/video_preferences.xml +++ b/res/xml/video_preferences.xml @@ -48,13 +48,6 @@ camera:entries="@array/pref_camera_video_tnr_entries" camera:entryValues="@array/pref_camera_video_tnr_entryvalues" /> <IconListPreference - camera:key="pref_camera_video_duration_key" - camera:defaultValue="@string/pref_camera_video_duration_default" - camera:title="@string/pref_camera_video_duration_title" - camera:singleIcon="@drawable/ic_settings_duration" - camera:entries="@array/pref_camera_video_duration_entries" - camera:entryValues="@array/pref_camera_video_duration_entryvalues" /> - <IconListPreference camera:key="pref_video_time_lapse_frame_interval_key" camera:defaultValue="@string/pref_video_time_lapse_frame_interval_default" camera:title="@string/pref_video_time_lapse_frame_interval_title" diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java index 1d8611333..9894480de 100755 --- a/src/com/android/camera/CameraSettings.java +++ b/src/com/android/camera/CameraSettings.java @@ -83,7 +83,6 @@ public class CameraSettings { public static final String KEY_VIDEO_ENCODER = "pref_camera_videoencoder_key"; public static final String KEY_AUDIO_ENCODER = "pref_camera_audioencoder_key"; - public static final String KEY_VIDEO_DURATION = "pref_camera_video_duration_key"; public static final String KEY_POWER_MODE = "pref_camera_powermode_key"; public static final String KEY_PICTURE_FORMAT = "pref_camera_pictureformat_key"; public static final String KEY_ZSL = "pref_camera_zsl_key"; @@ -201,10 +200,6 @@ public class CameraSettings { private static final String KEY_QC_PICTURE_FORMAT = "picture-format-values"; public static final String KEY_VIDEO_ROTATION = "pref_camera_video_rotation_key"; - private static final String VIDEO_QUALITY_HIGH = "high"; - private static final String VIDEO_QUALITY_MMS = "mms"; - private static final String VIDEO_QUALITY_YOUTUBE = "youtube"; - //manual 3A keys and parameter strings public static final String KEY_MANUAL_EXPOSURE = "pref_camera_manual_exp_key"; @@ -279,11 +274,6 @@ public class CameraSettings { public static final int CURRENT_VERSION = 5; public static final int CURRENT_LOCAL_VERSION = 2; - public static final int DEFAULT_VIDEO_DURATION = 0; // no limit - private static final int MMS_VIDEO_DURATION = (CamcorderProfile.get(CamcorderProfile.QUALITY_LOW) != null) ? - CamcorderProfile.get(CamcorderProfile.QUALITY_LOW).duration :30; - private static final int YOUTUBE_VIDEO_DURATION = 15 * 60; // 15 mins - private static final String TAG = "CameraSettings"; private final Context mContext; @@ -1321,7 +1311,6 @@ public class CameraSettings { // Just use video quality to replace it and // ignore the current settings. editor.remove("pref_camera_videoquality_key"); - editor.remove("pref_camera_video_duration_key"); } editor.putInt(KEY_VERSION, CURRENT_VERSION); @@ -1499,7 +1488,6 @@ public class CameraSettings { supported.add(Integer.toString(CamcorderProfile.QUALITY_QCIF)); } } - } public static ArrayList<String> getSupportedVideoQualities(int cameraId,Parameters parameters) { @@ -1515,14 +1503,6 @@ public class CameraSettings { } return supported; } - public static int getVideoDurationInMillis(String quality) { - if (VIDEO_QUALITY_MMS.equals(quality)) { - return MMS_VIDEO_DURATION * 1000; - } else if (VIDEO_QUALITY_YOUTUBE.equals(quality)) { - return YOUTUBE_VIDEO_DURATION * 1000; - } - return DEFAULT_VIDEO_DURATION * 1000; - } public static boolean isInternalPreviewSupported(Parameters params) { boolean ret = false; diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index da8eb038f..317c0c348 100755 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -4358,6 +4358,10 @@ public class CaptureModule implements CameraModule, PhotoController, private void updateMaxVideoDuration() { String minutesStr = mSettingsManager.getValue(SettingsManager.KEY_VIDEO_DURATION); + if (minutesStr == null) { + mMaxVideoDurationInMs = 0; + return; + } int minutes = Integer.parseInt(minutesStr); if (minutes == -1) { // User wants lowest, set 30s */ diff --git a/src/com/android/camera/SettingsActivity.java b/src/com/android/camera/SettingsActivity.java index ae7b48293..6cdaa5501 100755 --- a/src/com/android/camera/SettingsActivity.java +++ b/src/com/android/camera/SettingsActivity.java @@ -99,19 +99,6 @@ public class SettingsActivity extends PreferenceActivity { updatePreference(SettingsManager.KEY_VIDEO_ENCODER); }else if ( key.equals(SettingsManager.KEY_VIDEO_ENCODER) ) { updatePreference(SettingsManager.KEY_VIDEO_ENCODER_PROFILE); - } else if ( key.equals(SettingsManager.KEY_VIDEO_HIGH_FRAME_RATE) ) { - value = ((ListPreference) p).getValue(); - if (!value.equals("off")) { - int fpsRate = Integer.parseInt(value.substring(3)); - if (fpsRate == 480) { - mSettingsManager.filterVideoDurationFor480fps(); - } else { - mSettingsManager.filterVideoDuration(); - } - } else { - mSettingsManager.filterVideoDuration(); - } - updatePreference(SettingsManager.KEY_VIDEO_DURATION); } List<String> list = mSettingsManager.getDependentKeys(key); if (list != null) { @@ -684,7 +671,6 @@ public class SettingsActivity extends PreferenceActivity { updatePreference(SettingsManager.KEY_VIDEO_ENCODER); updatePreference(SettingsManager.KEY_ZOOM); updatePreference(SettingsManager.KEY_SWITCH_CAMERA); - updatePreference(SettingsManager.KEY_VIDEO_DURATION); updateMultiPreference(SettingsManager.KEY_STATS_VISUALIZER_VALUE); updatePictureSizePreferenceButton(); updateVideoHDRPreference(); @@ -786,7 +772,6 @@ public class SettingsActivity extends PreferenceActivity { idx = 0; } pref.setValueIndex(idx); - mSettingsManager.setValueIndex(key, idx); } } } diff --git a/src/com/android/camera/SettingsManager.java b/src/com/android/camera/SettingsManager.java index 253108603..51ac90b20 100755 --- a/src/com/android/camera/SettingsManager.java +++ b/src/com/android/camera/SettingsManager.java @@ -885,7 +885,6 @@ public class SettingsManager implements ListMenu.SettingsListener { ListPreference mpo = mPreferenceGroup.findPreference(KEY_MPO); ListPreference redeyeReduction = mPreferenceGroup.findPreference(KEY_REDEYE_REDUCTION); ListPreference videoQuality = mPreferenceGroup.findPreference(KEY_VIDEO_QUALITY); - ListPreference videoDuration = mPreferenceGroup.findPreference(KEY_VIDEO_DURATION); ListPreference audioEncoder = mPreferenceGroup.findPreference(KEY_AUDIO_ENCODER); ListPreference noiseReduction = mPreferenceGroup.findPreference(KEY_NOISE_REDUCTION); ListPreference faceDetection = mPreferenceGroup.findPreference(KEY_FACE_DETECTION); @@ -998,29 +997,6 @@ public class SettingsManager implements ListMenu.SettingsListener { } } - if (videoDuration != null) { - final SharedPreferences pref = mContext.getSharedPreferences( - ComboPreferences.getLocalSharedPreferencesName(mContext, cameraId), - Context.MODE_PRIVATE); - String fpsStr = pref.getString(SettingsManager.KEY_VIDEO_HIGH_FRAME_RATE, "off"); - if (fpsStr != null && !fpsStr.equals("off")) { - int fpsRate = Integer.parseInt(fpsStr.substring(3)); - if (fpsRate == 480) { - if (filterUnsupportedOptions(videoDuration, getSupportedVideoDurationFor480())) { - mFilteredKeys.add(videoDuration.getKey()); - } - } else { - if (filterUnsupportedOptions(videoDuration, getSupportedVideoDuration())) { - mFilteredKeys.add(videoDuration.getKey()); - } - } - } else { - if (filterUnsupportedOptions(videoDuration, getSupportedVideoDuration())) { - mFilteredKeys.add(videoDuration.getKey()); - } - } - } - if (!mIsMonoCameraPresent) { if (clearsight != null) removePreference(mPreferenceGroup, KEY_CLEARSIGHT); if (monoPreview != null) removePreference(mPreferenceGroup, KEY_MONO_PREVIEW); @@ -1712,24 +1688,6 @@ public class SettingsManager implements ListMenu.SettingsListener { return map.getOutputSizes(cl); } - private List<String> getSupportedVideoDuration() { - int[] videoDurations = {-1, 10, 30, 0}; - List<String> modes = new ArrayList<>(); - for (int i : videoDurations) { - modes.add(""+i); - } - return modes; - } - - private List<String> getSupportedVideoDurationFor480() { - int[] videoDurations = {48, 144, 0}; - List<String> modes = new ArrayList<>(); - for (int i : videoDurations) { - modes.add(""+i); - } - return modes; - } - private List<String> getSupportedVideoSize(int cameraId) { StreamConfigurationMap map = mCharacteristics.get(cameraId).get( CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP); @@ -2140,22 +2098,6 @@ public class SettingsManager implements ListMenu.SettingsListener { } } - public void filterVideoDuration() { - ListPreference videoDuration = mPreferenceGroup.findPreference(KEY_VIDEO_DURATION); - videoDuration.reloadInitialEntriesAndEntryValues(); - if (filterUnsupportedOptions(videoDuration, getSupportedVideoDuration())) { - mFilteredKeys.add(videoDuration.getKey()); - } - } - - public void filterVideoDurationFor480fps() { - ListPreference videoDuration = mPreferenceGroup.findPreference(KEY_VIDEO_DURATION); - videoDuration.reloadInitialEntriesAndEntryValues(); - if (filterUnsupportedOptions(videoDuration, getSupportedVideoDurationFor480())) { - mFilteredKeys.add(videoDuration.getKey()); - } - } - private boolean filterUnsupportedOptions(ListPreference pref, List<String> supported) { // Remove the preference if the parameter is not supported if (supported == null) { diff --git a/src/com/android/camera/VideoMenu.java b/src/com/android/camera/VideoMenu.java index ca6aa0687..971372bf8 100644 --- a/src/com/android/camera/VideoMenu.java +++ b/src/com/android/camera/VideoMenu.java @@ -112,7 +112,6 @@ public class VideoMenu extends MenuController mOtherKeys1 = new String[] { CameraSettings.KEY_VIDEOCAMERA_FLASH_MODE, CameraSettings.KEY_VIDEO_QUALITY, - CameraSettings.KEY_VIDEO_DURATION, CameraSettings.KEY_RECORD_LOCATION, CameraSettings.KEY_CAMERA_SAVEPATH, CameraSettings.KEY_WHITE_BALANCE, @@ -122,7 +121,6 @@ public class VideoMenu extends MenuController mOtherKeys2 = new String[] { CameraSettings.KEY_VIDEOCAMERA_FLASH_MODE, CameraSettings.KEY_VIDEO_QUALITY, - CameraSettings.KEY_VIDEO_DURATION, CameraSettings.KEY_RECORD_LOCATION, CameraSettings.KEY_CAMERA_SAVEPATH, CameraSettings.KEY_WHITE_BALANCE, diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index 6ffb37b77..15540ddc2 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -840,24 +840,6 @@ public class VideoModule implements CameraModule, Log.v(TAG, "Audio Encoder selected = " +mAudioEncoder); - String minutesStr = mPreferences.getString( - CameraSettings.KEY_VIDEO_DURATION, - mActivity.getString(R.string.pref_camera_video_duration_default)); - int minutes = -1; - try { - minutes = Integer.parseInt(minutesStr); - } catch(NumberFormatException npe) { - // use default value continue - minutes = Integer.parseInt(mActivity.getString( - R.string.pref_camera_video_duration_default)); - } - if (minutes == -1) { - // User wants lowest, set 30s */ - mMaxVideoDurationInMs = 30000; - } else { - // 1 minute = 60000ms - mMaxVideoDurationInMs = 60000 * minutes; - } if(ParametersWrapper.isPowerModeSupported(mParameters)) { String powermode = mPreferences.getString( CameraSettings.KEY_POWER_MODE, |