Issue #1201: auto-focus problem was fixed. Binaries were rebuilt.

This commit is contained in:
Alexander Smorkalov 2012-03-21 06:52:18 +00:00
parent ad2ee1d572
commit fa4977dff4
14 changed files with 15 additions and 4 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -5,4 +5,5 @@ Building camera wrapper for Android 3.0.1:
3) Get frameworks/base/include/gui/ISurfaceTexture.h and frameworks/base/include/gui/SurfaceTexture.h from Android 4.0.x (4.0.3 were used) sources and add them to your source tree.
4) Apply provided patch to the frameworks/base/include/gui/SurfaceTexture.h.
5) Pull /system/lib from your device running Andoid 3.x.x
6) Build wrapper as normal using this modified source tree.
6) Edit <Android Root>/development/sdk/platform_source.properties file. Set Android version to 3.0.1.
7) Build wrapper as normal using this modified source tree.

View File

@ -1,4 +1,4 @@
#if !defined(ANDROID_r2_2_2) && !defined(ANDROID_r2_3_3) && !defined(ANDROID_r3_0_1) && !defined(ANDROID_r4_0_0) && !defined(ANDROID_r4_0_3)
#if !defined(ANDROID_r2_2_0) && !defined(ANDROID_r2_3_3) && !defined(ANDROID_r3_0_1) && !defined(ANDROID_r4_0_0) && !defined(ANDROID_r4_0_3)
# error Building camera wrapper for your version of Android is not supported by OpenCV. You need to modify OpenCV sources in order to compile camera wrapper for your version of Android.
#endif
@ -227,7 +227,7 @@ CameraHandler* CameraHandler::initCameraConnect(const CameraCallback& callback,
sp<Camera> camera = 0;
#ifdef ANDROID_r2_2_2
#ifdef ANDROID_r2_2_0
camera = Camera::connect();
#else
/* This is 2.3 or higher. The connect method has cameraID parameter */
@ -313,9 +313,19 @@ CameraHandler* CameraHandler::initCameraConnect(const CameraCallback& callback,
}
}
const char* available_focus_modes = handler->params.get(CameraParameters::KEY_SUPPORTED_FOCUS_MODES);
if (available_focus_modes != 0)
{
// find auto focus mode
if (strstr(available_focus_modes, "auto") != NULL)
{
handler->params.set(CameraParameters::KEY_FOCUS_MODE, CameraParameters::FOCUS_MODE_AUTO);
camera->autoFocus();
}
}
status_t pdstatus;
#if defined(ANDROID_r2_2_2)
#if defined(ANDROID_r2_2_0)
pdstatus = camera->setPreviewDisplay(sp<ISurface>(0 /*new DummySurface*/));
if (pdstatus != 0)
LOGE("initCameraConnect: failed setPreviewDisplay(0) call; camera migth not work correctly on some devices");