mirror of
https://github.com/opencv/opencv.git
synced 2024-11-25 03:30:34 +08:00
Applying patch mentioned in ticket #1085
This commit is contained in:
parent
7fbcc1ec05
commit
72728b4481
@ -153,26 +153,18 @@ public class NativePreviewer extends SurfaceView implements
|
||||
Log.d("NativePreviewer", "Supported params: "
|
||||
+ mCamera.getParameters().flatten());
|
||||
|
||||
|
||||
// this is available in 8+
|
||||
// parameters.setExposureCompensation(0);
|
||||
if (parameters.getSupportedWhiteBalance().contains(whitebalance_mode)) {
|
||||
List<String> whiteBalanceModes = parameters.getSupportedWhiteBalance();
|
||||
if (whiteBalanceModes != null
|
||||
&& whiteBalanceModes.contains(whitebalance_mode) ) {
|
||||
parameters.setWhiteBalance(whitebalance_mode);
|
||||
}
|
||||
// if (parameters.getSupportedAntibanding().contains(
|
||||
// Camera.Parameters.ANTIBANDING_OFF)) {
|
||||
// parameters.setAntibanding(Camera.Parameters.ANTIBANDING_OFF);
|
||||
// }
|
||||
|
||||
List<String> fmodes = mCamera.getParameters().getSupportedFocusModes();
|
||||
// for(String x: fmodes){
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
if (parameters.get("meter-mode") != null)
|
||||
parameters.set("meter-mode", "meter-average");
|
||||
|
||||
List<String> fmodes = mCamera.getParameters().getSupportedFocusModes();
|
||||
if(fmodes != null)
|
||||
{
|
||||
int idx = fmodes.indexOf(Camera.Parameters.FOCUS_MODE_INFINITY);
|
||||
if (idx != -1) {
|
||||
parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_INFINITY);
|
||||
@ -183,6 +175,7 @@ public class NativePreviewer extends SurfaceView implements
|
||||
if (fmodes.indexOf(Camera.Parameters.FOCUS_MODE_AUTO) != -1) {
|
||||
hasAutoFocus = true;
|
||||
}
|
||||
}
|
||||
|
||||
List<String> scenemodes = mCamera.getParameters()
|
||||
.getSupportedSceneModes();
|
||||
@ -211,7 +204,7 @@ public class NativePreviewer extends SurfaceView implements
|
||||
initForACB();
|
||||
initForPCWB();
|
||||
|
||||
// Use only one buffer, so that we don't preview to many frames and bog
|
||||
// Use only one buffer, so that we don't preview too many frames and bog
|
||||
// down system
|
||||
byte[] buffer = new byte[bufSize];
|
||||
addCallbackBuffer(buffer);
|
||||
@ -480,3 +473,4 @@ public class NativePreviewer extends SurfaceView implements
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user