summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2019-11-28 23:40:41 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2019-11-28 23:40:41 -0800
commit971b5050362f40eb131ecf8a3519600672a86d6b (patch)
treea03c32308f2ed19e59c295750b1c6a5493552d0f
parentad443a8cb7f63dda092445de28b5a94eab784375 (diff)
parent67e42d72cb72fdf178a9bdda35cf7527f90871f4 (diff)
downloadandroid_packages_apps_Snap-971b5050362f40eb131ecf8a3519600672a86d6b.zip
android_packages_apps_Snap-971b5050362f40eb131ecf8a3519600672a86d6b.tar.gz
android_packages_apps_Snap-971b5050362f40eb131ecf8a3519600672a86d6b.tar.bz2
Merge "SnapdragonCamera: Filter less 720P videoSize when EIS enable" into camera-SnapdragonCamera.lnx.2.0
-rwxr-xr-xsrc/com/android/camera/SettingsActivity.java7
-rwxr-xr-xsrc/com/android/camera/SettingsManager.java48
2 files changed, 33 insertions, 22 deletions
diff --git a/src/com/android/camera/SettingsActivity.java b/src/com/android/camera/SettingsActivity.java
index 0658248..45878e2 100755
--- a/src/com/android/camera/SettingsActivity.java
+++ b/src/com/android/camera/SettingsActivity.java
@@ -160,11 +160,12 @@ public class SettingsActivity extends PreferenceActivity {
updateManualWBSettings();
}
- if (pref.getKey().equals(SettingsManager.KEY_VIDEO_QUALITY) ||
- pref.getKey().equals(SettingsManager.KEY_DIS) ||
+ if (pref.getKey().equals(SettingsManager.KEY_DIS) ||
pref.getKey().equals(SettingsManager.KEY_EIS_VALUE)) {
- updatePreference(SettingsManager.KEY_VIDEO_ENCODER);
+ mSettingsManager.filterEISVideQualityOptions();
+ updatePreference(SettingsManager.KEY_VIDEO_QUALITY);
}
+
}
}
};
diff --git a/src/com/android/camera/SettingsManager.java b/src/com/android/camera/SettingsManager.java
index 532eae8..8e55459 100755
--- a/src/com/android/camera/SettingsManager.java
+++ b/src/com/android/camera/SettingsManager.java
@@ -1091,9 +1091,6 @@ public class SettingsManager implements ListMenu.SettingsListener {
filterVideoEncoderProfileOptions();
} else if (pref.getKey().equals(KEY_PICTURE_FORMAT)) {
filterHeifSizeOptions();
- } else if (pref.getKey().equals(KEY_DIS) ||
- pref.getKey().equals(KEY_EIS_VALUE)) {
- filterVideoEncoderOptions();
}
}
@@ -1264,6 +1261,27 @@ public class SettingsManager implements ListMenu.SettingsListener {
}
}
+ private boolean getEISEnabled() {
+ boolean result = false;
+ ListPreference disPref = mPreferenceGroup.findPreference(KEY_DIS);
+ ListPreference eisPref = mPreferenceGroup.findPreference(KEY_EIS_VALUE);
+ if (disPref != null && eisPref != null) {
+ result = ("on".equals(disPref.getValue()) &&
+ !("disable".equals(eisPref.getValue())));
+ }
+ return result;
+ }
+
+ public void filterEISVideQualityOptions() {
+ ListPreference videoQualityPref = mPreferenceGroup.findPreference(KEY_VIDEO_QUALITY);
+ if (videoQualityPref == null) return;
+ videoQualityPref.reloadInitialEntriesAndEntryValues();
+ if (filterUnsupportedOptions(videoQualityPref, getSupportedVideoSize(
+ getCurrentCameraId()))) {
+ mFilteredKeys.add(videoQualityPref.getKey());
+ }
+ }
+
private void filterChromaflashPictureSizeOptions() {
String scene = getValue(SettingsManager.KEY_SCENE_MODE);
ListPreference picturePref = mPreferenceGroup.findPreference(KEY_PICTURE_SIZE);
@@ -1765,6 +1783,7 @@ public class SettingsManager implements ListMenu.SettingsListener {
StreamConfigurationMap map = mCharacteristics.get(cameraId).get(
CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
Size[] sizes = map.getOutputSizes(MediaRecorder.class);
+ boolean eisEnabled = getEISEnabled();
boolean isHeifEnabled = getSavePictureFormat() == HEIF_FORMAT;
VideoCapabilities heifCap = null;
if (isHeifEnabled) {
@@ -1786,6 +1805,13 @@ public class SettingsManager implements ListMenu.SettingsListener {
continue;
}
}
+ if (eisEnabled) {
+ // eis didn`t support less than 720P
+ if (Math.min(sizes[i].getWidth(),sizes[i].getHeight()) < 720 ||
+ Math.max(sizes[i].getWidth(),sizes[i].getHeight()) < 1280) {
+ continue;
+ }
+ }
if (CameraSettings.VIDEO_QUALITY_TABLE.containsKey(sizes[i].toString())) {
Integer profile = CameraSettings.VIDEO_QUALITY_TABLE.get(sizes[i].toString());
if (profile != null) {
@@ -1988,22 +2014,6 @@ public class SettingsManager implements ListMenu.SettingsListener {
}
}
- ListPreference videoQuality = mPreferenceGroup.findPreference(KEY_VIDEO_QUALITY);
- String videoSize = videoQuality.getValue();
- int indexX = videoSize.indexOf('x');
- int width = Integer.parseInt(videoSize.substring(0, indexX));
- int height = Integer.parseInt(videoSize.substring(indexX + 1));
- // Video quality less than 720P
- boolean isLess720P = width < 1280 && height < 720;
-
- ListPreference disPref = mPreferenceGroup.findPreference(KEY_DIS);
- ListPreference eisPref = mPreferenceGroup.findPreference(KEY_EIS_VALUE);
- if (isLess720P &&
- "on".equals(disPref.getValue()) &&
- !("disable".equals(eisPref.getValue()))) {
- supported.remove("mpeg-4-sp");
- }
-
return supported;
}