Commit fa4977df authored by Alexander Smorkalov's avatar Alexander Smorkalov

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

parent ad2ee1d5
...@@ -5,4 +5,5 @@ Building camera wrapper for Android 3.0.1: ...@@ -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. 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. 4) Apply provided patch to the frameworks/base/include/gui/SurfaceTexture.h.
5) Pull /system/lib from your device running Andoid 3.x.x 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.
\ No newline at end of file 7) Build wrapper as normal using this modified source tree.
\ No newline at end of file
#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. # 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 #endif
...@@ -227,7 +227,7 @@ CameraHandler* CameraHandler::initCameraConnect(const CameraCallback& callback, ...@@ -227,7 +227,7 @@ CameraHandler* CameraHandler::initCameraConnect(const CameraCallback& callback,
sp<Camera> camera = 0; sp<Camera> camera = 0;
#ifdef ANDROID_r2_2_2 #ifdef ANDROID_r2_2_0
camera = Camera::connect(); camera = Camera::connect();
#else #else
/* This is 2.3 or higher. The connect method has cameraID parameter */ /* This is 2.3 or higher. The connect method has cameraID parameter */
...@@ -313,9 +313,19 @@ CameraHandler* CameraHandler::initCameraConnect(const CameraCallback& callback, ...@@ -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; status_t pdstatus;
#if defined(ANDROID_r2_2_2) #if defined(ANDROID_r2_2_0)
pdstatus = camera->setPreviewDisplay(sp<ISurface>(0 /*new DummySurface*/)); pdstatus = camera->setPreviewDisplay(sp<ISurface>(0 /*new DummySurface*/));
if (pdstatus != 0) if (pdstatus != 0)
LOGE("initCameraConnect: failed setPreviewDisplay(0) call; camera migth not work correctly on some devices"); LOGE("initCameraConnect: failed setPreviewDisplay(0) call; camera migth not work correctly on some devices");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment