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,26 +153,18 @@ public class NativePreviewer extends SurfaceView implements
|
|||||||
Log.d("NativePreviewer", "Supported params: "
|
Log.d("NativePreviewer", "Supported params: "
|
||||||
+ mCamera.getParameters().flatten());
|
+ mCamera.getParameters().flatten());
|
||||||
|
|
||||||
|
List<String> whiteBalanceModes = parameters.getSupportedWhiteBalance();
|
||||||
// this is available in 8+
|
if (whiteBalanceModes != null
|
||||||
// parameters.setExposureCompensation(0);
|
&& whiteBalanceModes.contains(whitebalance_mode) ) {
|
||||||
if (parameters.getSupportedWhiteBalance().contains(whitebalance_mode)) {
|
|
||||||
parameters.setWhiteBalance(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)
|
if (parameters.get("meter-mode") != null)
|
||||||
parameters.set("meter-mode", "meter-average");
|
parameters.set("meter-mode", "meter-average");
|
||||||
|
|
||||||
|
List<String> fmodes = mCamera.getParameters().getSupportedFocusModes();
|
||||||
|
if(fmodes != null)
|
||||||
|
{
|
||||||
int idx = fmodes.indexOf(Camera.Parameters.FOCUS_MODE_INFINITY);
|
int idx = fmodes.indexOf(Camera.Parameters.FOCUS_MODE_INFINITY);
|
||||||
if (idx != -1) {
|
if (idx != -1) {
|
||||||
parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_INFINITY);
|
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) {
|
if (fmodes.indexOf(Camera.Parameters.FOCUS_MODE_AUTO) != -1) {
|
||||||
hasAutoFocus = true;
|
hasAutoFocus = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
List<String> scenemodes = mCamera.getParameters()
|
List<String> scenemodes = mCamera.getParameters()
|
||||||
.getSupportedSceneModes();
|
.getSupportedSceneModes();
|
||||||
@ -211,7 +204,7 @@ public class NativePreviewer extends SurfaceView implements
|
|||||||
initForACB();
|
initForACB();
|
||||||
initForPCWB();
|
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
|
// down system
|
||||||
byte[] buffer = new byte[bufSize];
|
byte[] buffer = new byte[bufSize];
|
||||||
addCallbackBuffer(buffer);
|
addCallbackBuffer(buffer);
|
||||||
@ -480,3 +473,4 @@ public class NativePreviewer extends SurfaceView implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user