summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CaptureModule.java
diff options
context:
space:
mode:
authorxianming wang <mingwax@codeaurora.org>2017-08-10 16:11:54 +0800
committerxianming wang <mingwax@codeaurora.org>2017-09-07 17:00:20 +0800
commit717dc48959a598c80c6f8cc881966d3792dfba50 (patch)
tree0551156c381fc184a6040d183086206472ab8006 /src/com/android/camera/CaptureModule.java
parent60a3993224259ed0f7dd58643befadc384fab1d1 (diff)
downloadandroid_packages_apps_Snap-717dc48959a598c80c6f8cc881966d3792dfba50.tar.gz
android_packages_apps_Snap-717dc48959a598c80c6f8cc881966d3792dfba50.tar.bz2
android_packages_apps_Snap-717dc48959a598c80c6f8cc881966d3792dfba50.zip
SnapdragonCamera: Complete the function of QCFA
Add support for quadraCFA in HAL3, and Complete the function of QCFA. CRs-Fixed: 2104228 Change-Id: I5ae17d1af3fc433402d0f183c48baf7488768328
Diffstat (limited to 'src/com/android/camera/CaptureModule.java')
-rwxr-xr-x[-rw-r--r--]src/com/android/camera/CaptureModule.java40
1 files changed, 33 insertions, 7 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 50cf0aa2b..a3fdc950a 100644..100755
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -230,7 +230,10 @@ public class CaptureModule implements CameraModule, PhotoController,
new CaptureResult.Key<>("org.codeaurora.qcamera3.histogram.stats", int[].class);
public static CameraCharacteristics.Key<Integer> isHdrScene =
new CameraCharacteristics.Key<>("org.codeaurora.qcamera3.stats.is_hdr_scene", Integer.class);
-
+ public static CameraCharacteristics.Key<Byte> IS_SUPPORT_QCFA_SENSOR =
+ new CameraCharacteristics.Key<>("org.codeaurora.qcamera3.quadra_cfa.is_qcfa_sensor", Byte.class);
+ public static CameraCharacteristics.Key<int[]> QCFA_SUPPORT_DIMENSION =
+ new CameraCharacteristics.Key<>("org.codeaurora.qcamera3.quadra_cfa.qcfa_dimension", int[].class);
public static CameraCharacteristics.Key<Byte> bsgcAvailable =
new CameraCharacteristics.Key<>("org.codeaurora.qcamera3.stats.bsgc_available", Byte.class);
public static CaptureResult.Key<byte[]> blinkDetected =
@@ -268,6 +271,7 @@ public class CaptureModule implements CameraModule, PhotoController,
private boolean mIsLinked = false;
private long mCaptureStartTime;
private boolean mPaused = true;
+ private boolean mIsSupportedQcfa = false;
private Semaphore mSurfaceReadyLock = new Semaphore(1);
private boolean mSurfaceReady = true;
private boolean[] mCameraOpened = new boolean[MAX_NUM_CAM];
@@ -1486,7 +1490,9 @@ public class CaptureModule implements CameraModule, PhotoController,
}
applySettingsForJpegInformation(captureBuilder, id);
- addPreviewSurface(captureBuilder, null, id);
+ if (!mIsSupportedQcfa) {
+ addPreviewSurface(captureBuilder, null, id);
+ }
VendorTagUtil.setCdsMode(captureBuilder, 2);// CDS 0-OFF, 1-ON, 2-AUTO
applySettingsForCapture(captureBuilder, id);
@@ -1499,7 +1505,9 @@ public class CaptureModule implements CameraModule, PhotoController,
if (mSaveRaw) {
captureBuilder.addTarget(mRawImageReader[id].getSurface());
}
- mCaptureSession[id].stopRepeating();
+ if (!mIsSupportedQcfa) {
+ mCaptureSession[id].stopRepeating();
+ }
if (mLongshotActive) {
captureStillPictureForLongshot(captureBuilder, id);
} else {
@@ -1772,13 +1780,21 @@ public class CaptureModule implements CameraModule, PhotoController,
}
mImageReader[i].setOnImageAvailableListener(mPostProcessor.getImageHandler(), mImageAvailableHandler);
mPostProcessor.onImageReaderReady(mImageReader[i], mSupportedMaxPictureSize, mPictureSize);
- } else {
+ } else if (i == getMainCameraId()) {
mImageReader[i] = ImageReader.newInstance(mPictureSize.getWidth(),
mPictureSize.getHeight(), imageFormat, PersistUtil.getLongshotShotLimit());
ImageAvailableListener listener = new ImageAvailableListener(i) {
@Override
public void onImageAvailable(ImageReader reader) {
+ if (mIsSupportedQcfa) {
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ mUI.enableShutter(true);
+ }
+ });
+ }
Log.d(TAG, "image available for cam: " + mCamId);
Image image = reader.acquireNextImage();
@@ -1911,7 +1927,9 @@ public class CaptureModule implements CameraModule, PhotoController,
@Override
public void run() {
mUI.stopSelfieFlash();
- mUI.enableShutter(true);
+ if (!mIsSupportedQcfa) {
+ mUI.enableShutter(true);
+ }
mUI.enableVideo(true);
}
});
@@ -2367,6 +2385,10 @@ public class CaptureModule implements CameraModule, PhotoController,
private void openProcessors() {
String scene = mSettingsManager.getValue(SettingsManager.KEY_SCENE_MODE);
+ mIsSupportedQcfa = mSettingsManager.getQcfaPrefEnabled() &&
+ mSettingsManager.getIsSupportedQcfa(getMainCameraId()) &&
+ mPictureSize.toString().equals(mSettingsManager.getSupportedQcfaDimension(
+ getMainCameraId()));
boolean isFlashOn = false;
boolean isMakeupOn = false;
boolean isSelfieMirrorOn = false;
@@ -2388,9 +2410,13 @@ public class CaptureModule implements CameraModule, PhotoController,
if (scene != null) {
int mode = Integer.parseInt(scene);
Log.d(TAG, "Chosen postproc filter id : " + getPostProcFilterId(mode));
- mPostProcessor.onOpen(getPostProcFilterId(mode), isFlashOn, isTrackingFocusSettingOn(), isMakeupOn, isSelfieMirrorOn, mSaveRaw);
+ mPostProcessor.onOpen(getPostProcFilterId(mode), isFlashOn,
+ isTrackingFocusSettingOn(), isMakeupOn, isSelfieMirrorOn,
+ mSaveRaw, mIsSupportedQcfa);
} else {
- mPostProcessor.onOpen(PostProcessor.FILTER_NONE, isFlashOn, isTrackingFocusSettingOn(), isMakeupOn, isSelfieMirrorOn, mSaveRaw);
+ mPostProcessor.onOpen(PostProcessor.FILTER_NONE, isFlashOn,
+ isTrackingFocusSettingOn(), isMakeupOn, isSelfieMirrorOn,
+ mSaveRaw, mIsSupportedQcfa);
}
}
if(mFrameProcessor != null) {