All HTC One S related changes reverted due to applyProperties problems on other devices. Libraries rebuilt.

This commit is contained in:
Alexander Smorkalov 2012-09-14 16:50:04 +04:00
parent 9efd7019ad
commit 8104164c78
17 changed files with 23 additions and 36 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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -357,6 +357,7 @@ const char* CameraHandler::antibandingModesNames[ANDROID_CAMERA_ANTIBANDING_MODE
CameraHandler* CameraHandler::initCameraConnect(const CameraCallback& callback, int cameraId, void* userData, CameraParameters* prevCameraParameters)
{
typedef sp<Camera> (*Android22ConnectFuncType)();
typedef sp<Camera> (*Android23ConnectFuncType)(int);
typedef sp<Camera> (*Android3DConnectFuncType)(int, int);
@ -391,19 +392,16 @@ CameraHandler* CameraHandler::initCameraConnect(const CameraCallback& callback,
{
LOGD("Connecting to CameraService v 2.2");
camera = Android22Connect();
LOGD("Connection to CameraService v 2.2 established");
}
else if (Android23ConnectFuncType Android23Connect = (Android23ConnectFuncType)dlsym(CameraHALHandle, Android23ConnectName))
{
LOGD("Connecting to CameraService v 2.3");
camera = Android23Connect(cameraId);
LOGD("Connection to CameraService v 2.3 established");
}
else if (Android3DConnectFuncType Android3DConnect = (Android3DConnectFuncType)dlsym(CameraHALHandle, Android3DConnectName))
{
LOGD("Connecting to CameraService v 3D");
camera = Android3DConnect(cameraId, CAMERA_SUPPORT_MODE_2D);
LOGD("Connection to CameraService v 3D established");
}
else
{
@ -414,23 +412,19 @@ CameraHandler* CameraHandler::initCameraConnect(const CameraCallback& callback,
dlclose(CameraHALHandle);
if ( NULL == camera.get() )
if ( 0 == camera.get() )
{
LOGE("initCameraConnect: Unable to connect to CameraService\n");
return 0;
}
LOGD("Creating camera handler");
CameraHandler* handler = new CameraHandler(callback, userData);
LOGD("Setting camera listener");
camera->setListener(handler);
LOGD("Updating camera handler");
handler->camera = camera;
handler->cameraId = cameraId;
LOGD("Checking previous camera parameters");
if (NULL != prevCameraParameters)
if (prevCameraParameters != 0)
{
LOGI("initCameraConnect: Setting paramers from previous camera handler");
camera->setParameters(prevCameraParameters->flatten());
@ -460,7 +454,7 @@ CameraHandler* CameraHandler::initCameraConnect(const CameraCallback& callback,
#if !defined(ANDROID_r2_2_0)
// Set focus mode to continuous-video if supported
const char* available_focus_modes = handler->params.get(CameraParameters::KEY_SUPPORTED_FOCUS_MODES);
if (NULL != available_focus_modes)
if (available_focus_modes != 0)
{
if (strstr(available_focus_modes, "continuous-video") != NULL)
{
@ -468,7 +462,7 @@ CameraHandler* CameraHandler::initCameraConnect(const CameraCallback& callback,
status_t resParams = handler->camera->setParameters(handler->params.flatten());
if (0 != resParams)
if (resParams != 0)
{
LOGE("initCameraConnect: failed to set autofocus mode to \"continuous-video\"");
}
@ -814,25 +808,19 @@ void CameraHandler::applyProperties(CameraHandler** ppcameraHandler)
{
LOGD("CameraHandler::applyProperties()");
if (NULL == ppcameraHandler)
if (ppcameraHandler == 0)
{
LOGE("applyProperties: Passed NULL ppcameraHandler");
return;
}
if (NULL == *ppcameraHandler)
if (*ppcameraHandler == 0)
{
LOGE("applyProperties: Passed null *ppcameraHandler");
return;
}
LOGD("CameraHandler::applyProperties()");
#if defined(ANDROID_r4_0_3)
LOGD("Reconnect camera");
(*ppcameraHandler)->camera->reconnect();
(*ppcameraHandler)->params = (*ppcameraHandler)->camera->getParameters();
#else
CameraHandler* previousCameraHandler=*ppcameraHandler;
CameraParameters curCameraParameters(previousCameraHandler->params.flatten());
@ -844,6 +832,7 @@ void CameraHandler::applyProperties(CameraHandler** ppcameraHandler)
previousCameraHandler->closeCameraConnect();
LOGD("CameraHandler::applyProperties(): after previousCameraHandler->closeCameraConnect");
LOGD("CameraHandler::applyProperties(): before initCameraConnect");
CameraHandler* handler=initCameraConnect(cameraCallback, cameraId, userData, &curCameraParameters);
LOGD("CameraHandler::applyProperties(): after initCameraConnect, handler=0x%x", (int)handler);
@ -855,9 +844,7 @@ void CameraHandler::applyProperties(CameraHandler** ppcameraHandler)
LOGE("ERROR in applyProperties --- cannot reinit camera AGAIN --- cannot do anything else");
}
}
(*ppcameraHandler)=handler;
#endif
}