summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/com/android/camera/CameraActivity.java3
-rwxr-xr-xsrc/com/android/camera/CameraHolder.java5
-rwxr-xr-xsrc/com/android/camera/CaptureModule.java3
-rwxr-xr-xsrc/com/android/camera/SettingsActivity.java6
-rwxr-xr-xsrc/com/android/camera/SettingsManager.java73
-rwxr-xr-xsrc/com/android/camera/imageprocessor/FrameProcessor.java15
-rwxr-xr-x[-rw-r--r--]src/com/android/camera/ui/FlashToggleButton.java10
-rwxr-xr-xsrc/com/android/camera/ui/OneUICameraControls.java1
-rwxr-xr-xversion.mk2
9 files changed, 91 insertions, 27 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index 9f225d1c7..2390afa8e 100755
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -641,7 +641,8 @@ public class CameraActivity extends Activity
View decorView = getWindow().getDecorView();
int currentSystemUIVisibility = decorView.getSystemUiVisibility();
int systemUIVisibility = DEFAULT_SYSTEM_UI_VISIBILITY;
- int systemUINotVisible = View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_FLAG_FULLSCREEN;
+ int systemUINotVisible = View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_FLAG_FULLSCREEN |
+ View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
int newSystemUIVisibility = systemUIVisibility
| (visible ? View.SYSTEM_UI_FLAG_VISIBLE : systemUINotVisible);
diff --git a/src/com/android/camera/CameraHolder.java b/src/com/android/camera/CameraHolder.java
index d5167af5b..f7ee1af88 100755
--- a/src/com/android/camera/CameraHolder.java
+++ b/src/com/android/camera/CameraHolder.java
@@ -23,6 +23,7 @@ import android.hardware.Camera.CameraInfo;
import android.hardware.Camera.Parameters;
import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCharacteristics;
+import android.hardware.camera2.CameraMetadata;
import android.os.Build;
import android.os.Handler;
import android.os.HandlerThread;
@@ -182,10 +183,10 @@ public class CameraHolder {
= manager.getCameraCharacteristics(cameraId);
Log.d(TAG,"cameraIdList size ="+cameraIdList.length);
int facing = characteristics.get(CameraCharacteristics.LENS_FACING);
- if (facing == CameraCharacteristics.LENS_FACING_FRONT) {
+ if (mFrontCameraId == -1 && facing == CameraMetadata.LENS_FACING_FRONT) {
CaptureModule.FRONT_ID = i;
mFrontCameraId = i;
- } else if (mBackCameraId != -1) {
+ } else if (mBackCameraId == -1 && facing == CameraMetadata.LENS_FACING_BACK) {
mBackCameraId = i;
}
mCharacteristics.add(i, characteristics);
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 8aa654b21..d4db0b771 100755
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -5502,12 +5502,12 @@ public class CaptureModule implements CameraModule, PhotoController,
if (mCaptureTimeLapse) {
size = CameraSettings.getTimeLapseQualityFor(size);
}
-
Bundle myExtras = intent.getExtras();
if (mMediaRecorder == null) mMediaRecorder = new MediaRecorder();
updateHFRSetting();
+ mHighSpeedCapture = mHighSpeedCapture && (myExtras == null); //MMS not support high speed
boolean hfr = mHighSpeedCapture && !mHighSpeedRecordingMode;
if (CamcorderProfile.hasProfile(cameraId, size)) {
@@ -5640,7 +5640,6 @@ public class CaptureModule implements CameraModule, PhotoController,
if (requestedSizeLimit > 0 && requestedSizeLimit < maxFileSize) {
maxFileSize = requestedSizeLimit;
}
-
if (Storage.isSaveSDCard() && maxFileSize > SDCARD_SIZE_LIMIT) {
maxFileSize = SDCARD_SIZE_LIMIT;
}
diff --git a/src/com/android/camera/SettingsActivity.java b/src/com/android/camera/SettingsActivity.java
index ae7b48293..3fef92493 100755
--- a/src/com/android/camera/SettingsActivity.java
+++ b/src/com/android/camera/SettingsActivity.java
@@ -159,6 +159,12 @@ public class SettingsActivity extends PreferenceActivity {
if ( (pref.getKey().equals(SettingsManager.KEY_MANUAL_WB)) ) {
updateManualWBSettings();
}
+
+ if (pref.getKey().equals(SettingsManager.KEY_VIDEO_QUALITY) ||
+ pref.getKey().equals(SettingsManager.KEY_DIS) ||
+ pref.getKey().equals(SettingsManager.KEY_EIS_VALUE)) {
+ updatePreference(SettingsManager.KEY_VIDEO_ENCODER);
+ }
}
}
};
diff --git a/src/com/android/camera/SettingsManager.java b/src/com/android/camera/SettingsManager.java
index 253108603..532eae8ec 100755
--- a/src/com/android/camera/SettingsManager.java
+++ b/src/com/android/camera/SettingsManager.java
@@ -1091,6 +1091,9 @@ 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();
}
}
@@ -1670,10 +1673,26 @@ public class SettingsManager implements ListMenu.SettingsListener {
res.add(getSupportedQcfaDimension(cameraId));
}
+ VideoCapabilities heifCap = null;
+ if (isHeifEnabled) {
+ MediaCodecList list = new MediaCodecList(MediaCodecList.REGULAR_CODECS);
+ for (MediaCodecInfo info :list.getCodecInfos()) {
+ if (info.isEncoder() && info.getName().contains("heic")){
+ heifCap = info.getCapabilitiesForType(
+ MediaFormat.MIMETYPE_IMAGE_ANDROID_HEIC).getVideoCapabilities();
+ Log.d(TAG,"supported heif height range ="+heifCap.getSupportedHeights().toString() +
+ " width range ="+heifCap.getSupportedWidths().toString());
+ }
+ }
+ }
+
if (sizes != null) {
for (int i = 0; i < sizes.length; i++) {
- if (isHeifEnabled && (Math.min(sizes[i].getWidth(),sizes[i].getHeight()) < 512)) {
- continue;
+ if (isHeifEnabled && heifCap != null ){
+ if (!heifCap.getSupportedWidths().contains(sizes[i].getWidth()) ||
+ !heifCap.getSupportedHeights().contains(sizes[i].getHeight())){
+ continue;
+ }
}
if (isDeepportrait &&
(Math.min(sizes[i].getWidth(),sizes[i].getHeight()) < 720 ||
@@ -1686,8 +1705,15 @@ public class SettingsManager implements ListMenu.SettingsListener {
}
Size[] highResSizes = map.getHighResolutionOutputSizes(ImageFormat.JPEG);
+
if (highResSizes != null) {
for (int i = 0; i < highResSizes.length; i++) {
+ if (isHeifEnabled && heifCap != null) {
+ if (!heifCap.getSupportedWidths().contains(highResSizes[i].getWidth()) ||
+ !heifCap.getSupportedHeights().contains(highResSizes[i].getHeight())){
+ continue;
+ }
+ }
res.add(highResSizes[i].toString());
}
}
@@ -1709,7 +1735,12 @@ public class SettingsManager implements ListMenu.SettingsListener {
public Size[] getSupportedOutputSize(int cameraId, Class cl) {
StreamConfigurationMap map = mCharacteristics.get(cameraId).get(
CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
- return map.getOutputSizes(cl);
+ Size[] normal = map.getOutputSizes(cl);
+ Size[] high = map.getHighResolutionOutputSizes(ImageFormat.PRIVATE);
+ Size[] ret = new Size[normal.length+high.length];
+ System.arraycopy(normal,0,ret,0,normal.length);
+ System.arraycopy(high,0,ret,normal.length,high.length);
+ return ret;
}
private List<String> getSupportedVideoDuration() {
@@ -1735,10 +1766,25 @@ public class SettingsManager implements ListMenu.SettingsListener {
CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
Size[] sizes = map.getOutputSizes(MediaRecorder.class);
boolean isHeifEnabled = getSavePictureFormat() == HEIF_FORMAT;
+ VideoCapabilities heifCap = null;
+ if (isHeifEnabled) {
+ MediaCodecList list = new MediaCodecList(MediaCodecList.REGULAR_CODECS);
+ for (MediaCodecInfo info :list.getCodecInfos()) {
+ if (info.isEncoder() && info.getName().contains("heic")){
+ heifCap = info.getCapabilitiesForType(
+ MediaFormat.MIMETYPE_IMAGE_ANDROID_HEIC).getVideoCapabilities();
+ Log.d(TAG,"supported heif height range ="+heifCap.getSupportedHeights().toString() +
+ " width range ="+heifCap.getSupportedWidths().toString());
+ }
+ }
+ }
List<String> res = new ArrayList<>();
for (int i = 0; i < sizes.length; i++) {
- if (isHeifEnabled && (Math.min(sizes[i].getWidth(),sizes[i].getHeight()) < 512)) {
- continue;
+ if (isHeifEnabled && heifCap != null ){
+ if (!heifCap.getSupportedWidths().contains(sizes[i].getWidth()) ||
+ !heifCap.getSupportedHeights().contains(sizes[i].getHeight())){
+ continue;
+ }
}
if (CameraSettings.VIDEO_QUALITY_TABLE.containsKey(sizes[i].toString())) {
Integer profile = CameraSettings.VIDEO_QUALITY_TABLE.get(sizes[i].toString());
@@ -1941,6 +1987,23 @@ 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;
}
diff --git a/src/com/android/camera/imageprocessor/FrameProcessor.java b/src/com/android/camera/imageprocessor/FrameProcessor.java
index 6397229f0..cd1a5f8a2 100755
--- a/src/com/android/camera/imageprocessor/FrameProcessor.java
+++ b/src/com/android/camera/imageprocessor/FrameProcessor.java
@@ -81,8 +81,6 @@ public class FrameProcessor {
private ListeningTask mListeningTask;
private RenderScript mRs;
private Activity mActivity;
- ScriptC_YuvToRgb mRsYuvToRGB;
- ScriptC_rotator mRsRotator;
private Size mSize;
private Object mAllocationLock = new Object();
private boolean mIsAllocationEverUsed;
@@ -108,8 +106,6 @@ public class FrameProcessor {
mFinalFilters = new ArrayList<ImageFilter>();
mRs = RenderScript.create(mActivity);
- mRsYuvToRGB = new ScriptC_YuvToRgb(mRs);
- mRsRotator = new ScriptC_rotator(mRs);
}
private void init(Size previewDim) {
@@ -158,11 +154,6 @@ public class FrameProcessor {
Type.Builder nv21TypeBuilder = new Type.Builder(mRs, Element.U8(mRs));
nv21TypeBuilder.setX(width * height * 3 / 2);
mProcessAllocation = Allocation.createTyped(mRs, nv21TypeBuilder.create(), Allocation.USAGE_SCRIPT);
- mRsRotator.set_gIn(mInputAllocation);
- mRsRotator.set_gOut(mProcessAllocation);
- mRsRotator.set_width(width);
- mRsRotator.set_height(height);
- mRsRotator.set_pad(stridePad);
int degree = 90;
if(mModule.getMainCameraCharacteristics() != null) {
degree = mModule.getMainCameraCharacteristics().
@@ -171,10 +162,6 @@ public class FrameProcessor {
degree = Math.abs(degree - 90);
}
}
- mRsRotator.set_degree(degree);
- mRsYuvToRGB.set_gIn(mProcessAllocation);
- mRsYuvToRGB.set_width(height);
- mRsYuvToRGB.set_height(width);
}
public ArrayList<ImageFilter> getFrameFilters() {
@@ -491,8 +478,6 @@ public class FrameProcessor {
createAllocation(stride, height, stride - width);
}
mInputAllocation.copyFrom(yvuBytes);
- mRsRotator.forEach_rotate90andMerge(mInputAllocation);
- mRsYuvToRGB.forEach_nv21ToRgb(mOutputAllocation);
mOutputAllocation.ioSend();
if (mVideoOutputAllocation != null) {
mVideoOutputAllocation.copyFrom(mOutputAllocation);
diff --git a/src/com/android/camera/ui/FlashToggleButton.java b/src/com/android/camera/ui/FlashToggleButton.java
index fa766bfb8..fca76b7a1 100644..100755
--- a/src/com/android/camera/ui/FlashToggleButton.java
+++ b/src/com/android/camera/ui/FlashToggleButton.java
@@ -71,8 +71,16 @@ public class FlashToggleButton extends RotateImageView {
String userSetting = mContext.getString(
R.string.pref_camera_manual_exp_value_user_setting);
String manualExposureMode = mSettingsManager.getValue(SettingsManager.KEY_MANUAL_EXPOSURE);
+ String scene = mSettingsManager.getValue(SettingsManager.KEY_SCENE_MODE);
+ boolean promode = false;
+ if (scene != null) {
+ int mode = Integer.parseInt(scene);
+ if (mode == SettingsManager.SCENE_MODE_PROMODE_INT) {
+ promode = true;
+ }
+ }
if (mIndex == -1 || (redeye != null && redeye.equals("on")) ||
- manualExposureMode.equals(userSetting)) {
+ manualExposureMode.equals(userSetting) || promode) {
setVisibility(GONE);
return;
} else {
diff --git a/src/com/android/camera/ui/OneUICameraControls.java b/src/com/android/camera/ui/OneUICameraControls.java
index fb7f9d6fd..20b1fa67f 100755
--- a/src/com/android/camera/ui/OneUICameraControls.java
+++ b/src/com/android/camera/ui/OneUICameraControls.java
@@ -593,6 +593,7 @@ public class OneUICameraControls extends RotatableLayout {
mProModeCloseButton.setVisibility(INVISIBLE);
return;
}
+ setProModeParameters();
mProModeLayout.setVisibility(VISIBLE);
mProModeCloseButton.setVisibility(VISIBLE);
mProModeLayout.setY(mHeight - mBottom - mProModeLayout.getHeight());
diff --git a/version.mk b/version.mk
index e64719dee..548001eaf 100755
--- a/version.mk
+++ b/version.mk
@@ -40,7 +40,7 @@
# base_version_build is 3 digits and auto-increment for fixing CR.
base_version_major := 2
base_version_minor := 02
-base_version_build := 033
+base_version_build := 035
#####################################################
#####################################################