diff options
author | xianming wang <mingwax@codeaurora.org> | 2017-10-31 16:53:12 +0800 |
---|---|---|
committer | xianming wang <mingwax@codeaurora.org> | 2017-11-02 10:56:18 +0800 |
commit | fb7ebd8f0470282ef455eb0a1b225e38c7333d03 (patch) | |
tree | fb0ab4ae3aea4b303678edcf5fb00f999fd0cf14 /src | |
parent | 40ba086c3c9d4a581c043de0992549c86e247e57 (diff) | |
download | android_packages_apps_Snap-fb7ebd8f0470282ef455eb0a1b225e38c7333d03.tar.gz android_packages_apps_Snap-fb7ebd8f0470282ef455eb0a1b225e38c7333d03.tar.bz2 android_packages_apps_Snap-fb7ebd8f0470282ef455eb0a1b225e38c7333d03.zip |
SnapdragonCamera: Fix camera exits when set histogram enable
SDM845 get the CaptureModule.histogramStats length is 768, only
support three histogramStats R, GB/GR, B.
CRs-Fixed: 2132098
Change-Id: I185057ccd7faa5a4f51fffede4ba090d5b87c702
Diffstat (limited to 'src')
-rwxr-xr-x | src/com/android/camera/CaptureModule.java | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index 536acea30..1e2037e56 100755 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -269,7 +269,7 @@ public class CaptureModule implements CameraModule, PhotoController, // The degrees of the device rotated clockwise from its natural orientation. private int mOrientation = OrientationEventListener.ORIENTATION_UNKNOWN; /*Histogram variables*/ - private Camera2GraphView mGraphViewR,mGraphViewGR,mGraphViewGB,mGraphViewB; + private Camera2GraphView mGraphViewR,mGraphViewGB,mGraphViewB; /*HDR Test*/ private boolean mCaptureHDRTestEnable = false; boolean mHiston = false; @@ -391,7 +391,8 @@ public class CaptureModule implements CameraModule, PhotoController, private int mHighSpeedCaptureRate; private CaptureRequest.Builder mVideoRequestBuilder; - public static int statsdata[] = new int[1024]; + private static final int STATS_DATA = 768; + public static int statsdata[] = new int[STATS_DATA]; private static final int SELFIE_FLASH_DURATION = 680; @@ -596,7 +597,7 @@ public class CaptureModule implements CameraModule, PhotoController, /*The first element in the array stores max hist value . Stats data begin from second value*/ synchronized (statsdata) { - System.arraycopy(histogramStats, 0, statsdata, 0, 1024); + System.arraycopy(histogramStats, 0, statsdata, 0, STATS_DATA); } updateGraghView(); } @@ -903,19 +904,14 @@ public class CaptureModule implements CameraModule, PhotoController, mNamedImages = new NamedImages(); mGraphViewR = (Camera2GraphView) mRootView.findViewById(R.id.graph_view_r); - mGraphViewGR = (Camera2GraphView) mRootView.findViewById(R.id.graph_view_gr); mGraphViewGB = (Camera2GraphView) mRootView.findViewById(R.id.graph_view_gb); mGraphViewB = (Camera2GraphView) mRootView.findViewById(R.id.graph_view_b); mGraphViewR.setDataSection(0,256); - mGraphViewGR.setDataSection(256,512); - mGraphViewGB.setDataSection(512,768); - mGraphViewB.setDataSection(768,1024); + mGraphViewGB.setDataSection(256,512); + mGraphViewB.setDataSection(512,768); if (mGraphViewR != null){ mGraphViewR.setCaptureModuleObject(this); } - if (mGraphViewGR != null){ - mGraphViewGR.setCaptureModuleObject(this); - } if (mGraphViewGB != null){ mGraphViewGB.setCaptureModuleObject(this); } @@ -2964,9 +2960,6 @@ public class CaptureModule implements CameraModule, PhotoController, if (mGraphViewR != null) { mGraphViewR.setRotation(-mOrientation); } - if (mGraphViewGR != null) { - mGraphViewGR.setRotation(-mOrientation); - } if (mGraphViewGB != null) { mGraphViewGB.setRotation(-mOrientation); } @@ -2977,23 +2970,16 @@ public class CaptureModule implements CameraModule, PhotoController, // need to re-initialize mGraphView to show histogram on rotate mGraphViewR = (Camera2GraphView) mRootView.findViewById(R.id.graph_view_r); - mGraphViewGR = (Camera2GraphView) mRootView.findViewById(R.id.graph_view_gr); mGraphViewGB = (Camera2GraphView) mRootView.findViewById(R.id.graph_view_gb); mGraphViewB = (Camera2GraphView) mRootView.findViewById(R.id.graph_view_b); mGraphViewR.setDataSection(0,256); - mGraphViewGR.setDataSection(256,512); - mGraphViewGB.setDataSection(512,768); - mGraphViewB.setDataSection(768,1024); + mGraphViewGB.setDataSection(256,512); + mGraphViewB.setDataSection(512,768); if(mGraphViewR != null){ mGraphViewR.setAlpha(0.75f); mGraphViewR.setCaptureModuleObject(this); mGraphViewR.PreviewChanged(); } - if(mGraphViewGR != null){ - mGraphViewGR.setAlpha(0.75f); - mGraphViewGR.setCaptureModuleObject(this); - mGraphViewGR.PreviewChanged(); - } if(mGraphViewGB != null){ mGraphViewGB.setAlpha(0.75f); mGraphViewGB.setCaptureModuleObject(this); @@ -4083,9 +4069,6 @@ public class CaptureModule implements CameraModule, PhotoController, if(mGraphViewR != null) { mGraphViewR.setVisibility(visibility); } - if(mGraphViewGR != null) { - mGraphViewGR.setVisibility(visibility); - } if(mGraphViewGB != null) { mGraphViewGB.setVisibility(visibility); } @@ -4102,9 +4085,6 @@ public class CaptureModule implements CameraModule, PhotoController, if(mGraphViewR != null) { mGraphViewR.PreviewChanged(); } - if(mGraphViewGR != null) { - mGraphViewGR.PreviewChanged(); - } if(mGraphViewGB != null) { mGraphViewGB.PreviewChanged(); } |