mirror of
https://github.com/opencv/opencv.git
synced 2024-11-28 21:20:18 +08:00
Applying patch mentioned in ticket #1085
This commit is contained in:
parent
7fbcc1ec05
commit
72728b4481
@ -153,35 +153,28 @@ 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");
|
||||
int idx = fmodes.indexOf(Camera.Parameters.FOCUS_MODE_INFINITY);
|
||||
if (idx != -1) {
|
||||
parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_INFINITY);
|
||||
} else if (fmodes.indexOf(Camera.Parameters.FOCUS_MODE_FIXED) != -1) {
|
||||
parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_FIXED);
|
||||
}
|
||||
|
||||
if (fmodes.indexOf(Camera.Parameters.FOCUS_MODE_AUTO) != -1) {
|
||||
hasAutoFocus = true;
|
||||
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);
|
||||
} else if (fmodes.indexOf(Camera.Parameters.FOCUS_MODE_FIXED) != -1) {
|
||||
parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_FIXED);
|
||||
}
|
||||
|
||||
if (fmodes.indexOf(Camera.Parameters.FOCUS_MODE_AUTO) != -1) {
|
||||
hasAutoFocus = true;
|
||||
}
|
||||
}
|
||||
|
||||
List<String> scenemodes = mCamera.getParameters()
|
||||
@ -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);
|
||||
@ -479,4 +472,5 @@ public class NativePreviewer extends SurfaceView implements
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user