summaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
authorKyle Repinski <repinski23@gmail.com>2015-01-06 23:50:55 -0600
committerZiyan <jaraidaniel@gmail.com>2015-04-11 20:24:52 +0200
commitc52c76fa1593f374173a818b4de5bd7c51903fbc (patch)
tree9235f74121a9acd3f90cf53435df2a7799b80cd6 /camera
parent0f63d0e84746ec4e3851ac5456e165f3365a42f6 (diff)
downloaddevice_samsung_tuna-c52c76fa1593f374173a818b4de5bd7c51903fbc.zip
device_samsung_tuna-c52c76fa1593f374173a818b4de5bd7c51903fbc.tar.gz
device_samsung_tuna-c52c76fa1593f374173a818b4de5bd7c51903fbc.tar.bz2
camera: More-or-less disable face detection.
This is causing a lot of problems.
Diffstat (limited to 'camera')
-rw-r--r--camera/AppCallbackNotifier.cpp8
-rw-r--r--camera/BaseCameraAdapter.cpp2
-rw-r--r--camera/CameraHal.cpp4
-rwxr-xr-xcamera/OMXCameraAdapter/OMXCameraAdapter.cpp4
-rw-r--r--camera/OMXCameraAdapter/OMXCapture.cpp6
-rw-r--r--camera/OMXCameraAdapter/OMXFocus.cpp6
6 files changed, 24 insertions, 6 deletions
diff --git a/camera/AppCallbackNotifier.cpp b/camera/AppCallbackNotifier.cpp
index 872006b..4103699 100644
--- a/camera/AppCallbackNotifier.cpp
+++ b/camera/AppCallbackNotifier.cpp
@@ -297,7 +297,7 @@ bool AppCallbackNotifier::notificationThread()
if(mFrameQ.hasMsg()) {
///Received a frame from one of the frame providers
- //CAMHAL_LOGDA("Notification Thread received a frame from frame provider (CameraAdapter)");
+ CAMHAL_LOGDA("Notification Thread received a frame from frame provider (CameraAdapter)");
notifyFrame();
}
@@ -404,6 +404,7 @@ void AppCallbackNotifier::notifyEvent()
break;
+#ifndef OMAP_TUNA
case CameraHalEvent::EVENT_FACE:
faceEvtData = evt->mEventData->faceEvent;
@@ -430,6 +431,7 @@ void AppCallbackNotifier::notifyEvent()
}
break;
+#endif
case CameraHalEvent::ALL_EVENTS:
break;
@@ -764,8 +766,8 @@ void AppCallbackNotifier::copyAndSendPreviewFrame(CameraFrame* frame, int32_t ms
memset(dest, 0, (mPreviewMemory->size / MAX_BUFFERS));
}
} else {
- if ((NULL == frame->mYuv[0]) || (NULL == frame->mYuv[1])){
- CAMHAL_LOGEA("Error! One of the YUV Pointer is NULL");
+ if ((0 == frame->mYuv[0]) || (0 == frame->mYuv[1])){ //NULL ==
+ CAMHAL_LOGEA("Error! One of the YUV Pointer is 0"); //is NULL
goto exit;
}
else{
diff --git a/camera/BaseCameraAdapter.cpp b/camera/BaseCameraAdapter.cpp
index 309e547..458c79e 100644
--- a/camera/BaseCameraAdapter.cpp
+++ b/camera/BaseCameraAdapter.cpp
@@ -959,6 +959,7 @@ status_t BaseCameraAdapter::sendCommand(CameraCommands operation, int value1, in
break;
+#ifndef OMAP_TUNA
case CameraAdapter::CAMERA_START_FD:
ret = startFaceDetection();
@@ -970,6 +971,7 @@ status_t BaseCameraAdapter::sendCommand(CameraCommands operation, int value1, in
ret = stopFaceDetection();
break;
+#endif
case CameraAdapter::CAMERA_SWITCH_TO_EXECUTING:
ret = switchToExecuting();
diff --git a/camera/CameraHal.cpp b/camera/CameraHal.cpp
index 20e05c4..7a5fdc0 100644
--- a/camera/CameraHal.cpp
+++ b/camera/CameraHal.cpp
@@ -2760,7 +2760,7 @@ status_t CameraHal::sendCommand(int32_t cmd, int32_t arg1, int32_t arg2)
ret = mCameraAdapter->sendCommand(CameraAdapter::CAMERA_STOP_SMOOTH_ZOOM);
break;
-
+#ifndef OMAP_TUNA
case CAMERA_CMD_START_FACE_DETECTION:
ret = mCameraAdapter->sendCommand(CameraAdapter::CAMERA_START_FD);
@@ -2772,7 +2772,7 @@ status_t CameraHal::sendCommand(int32_t cmd, int32_t arg1, int32_t arg2)
ret = mCameraAdapter->sendCommand(CameraAdapter::CAMERA_STOP_FD);
break;
-
+#endif
default:
break;
};
diff --git a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
index 49f9f8c..1ae440d 100755
--- a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
+++ b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
@@ -2554,12 +2554,14 @@ void OMXCameraAdapter::onOrientationEvent(uint32_t orientation, uint32_t tilt)
if (device_orientation != mDeviceOrientation) {
mDeviceOrientation = device_orientation;
+#ifndef OMAP_TUNA
mFaceDetectionLock.lock();
if (mFaceDetectionRunning) {
// restart face detection with new rotation
setFaceDetection(true, mDeviceOrientation);
}
mFaceDetectionLock.unlock();
+#endif
}
CAMHAL_LOGVB("orientation = %d tilt = %d device_orientation = %d", orientation, tilt, mDeviceOrientation);
@@ -2975,6 +2977,7 @@ OMX_ERRORTYPE OMXCameraAdapter::OMXCameraAdapterFillBufferDone(OMX_IN OMX_HANDLE
}
recalculateFPS();
+#ifndef OMAP_TUNA
{
Mutex::Autolock lock(mFaceDetectionLock);
if ( mFaceDetectionRunning && !mFaceDetectionPaused ) {
@@ -2996,6 +2999,7 @@ OMX_ERRORTYPE OMXCameraAdapter::OMXCameraAdapterFillBufferDone(OMX_IN OMX_HANDLE
}
}
}
+#endif
///Prepare the frames to be sent - initialize CameraFrame object and reference count
// TODO(XXX): ancillary data for snapshot frame is not being sent for video snapshot
diff --git a/camera/OMXCameraAdapter/OMXCapture.cpp b/camera/OMXCameraAdapter/OMXCapture.cpp
index 0a622cc..34a0357 100644
--- a/camera/OMXCameraAdapter/OMXCapture.cpp
+++ b/camera/OMXCameraAdapter/OMXCapture.cpp
@@ -743,8 +743,10 @@ status_t OMXCameraAdapter::startImageCapture()
return NO_ERROR;
}
+#ifndef OMAP_TUNA
// Camera framework doesn't expect face callbacks once capture is triggered
pauseFaceDetection(true);
+#endif
//During bracketing image capture is already active
{
@@ -922,9 +924,11 @@ status_t OMXCameraAdapter::stopImageCapture()
}
}
+#ifndef OMAP_TUNA
// After capture, face detection should be disabled
// and application needs to restart face detection
stopFaceDetection();
+#endif
//Wait here for the capture to be done, in worst case timeout and proceed with cleanup
mCaptureSem.WaitTimeout(OMX_CAPTURE_TIMEOUT);
@@ -1092,7 +1096,7 @@ status_t OMXCameraAdapter::UseBuffersCapture(void* bufArr, int num)
//TODO: Support more pixelformats
CAMHAL_LOGDB("Params Width = %d", (int)imgCaptureData->mWidth);
- CAMHAL_LOGDB("Params Height = %d", (int)imgCaptureData->mWidth);
+ CAMHAL_LOGDB("Params Height = %d", (int)imgCaptureData->mHeight);
if (mPendingCaptureSettings & SetFormat) {
mPendingCaptureSettings &= ~SetFormat;
diff --git a/camera/OMXCameraAdapter/OMXFocus.cpp b/camera/OMXCameraAdapter/OMXFocus.cpp
index 32478af..f584184 100644
--- a/camera/OMXCameraAdapter/OMXFocus.cpp
+++ b/camera/OMXCameraAdapter/OMXFocus.cpp
@@ -110,8 +110,10 @@ status_t OMXCameraAdapter::doAutoFocus()
OMX_INIT_STRUCT_PTR (&focusStatus, OMX_PARAM_FOCUSSTATUSTYPE);
+#ifndef OMAP_TUNA
// If the app calls autoFocus, the camera will stop sending face callbacks.
pauseFaceDetection(true);
+#endif
// This is needed for applying FOCUS_REGION correctly
if ( (!mFocusAreas.isEmpty()) && (!mFocusAreas.itemAt(0)->isZeroArea()))
@@ -319,8 +321,10 @@ status_t OMXCameraAdapter::cancelAutoFocus()
// re-apply CAF after unlocking and canceling
// mPending3Asettings |= SetFocus;
}
+#ifndef OMAP_TUNA
// If the apps call #cancelAutoFocus()}, the face callbacks will also resume.
pauseFaceDetection(false);
+#endif
LOG_FUNCTION_NAME_EXIT;
@@ -472,8 +476,10 @@ status_t OMXCameraAdapter::returnFocusStatus(bool timeoutReached)
notifyFocusSubscribers(focusStatus);
}
+#ifndef OMAP_TUNA
// After focus, face detection will resume sending face callbacks
pauseFaceDetection(false);
+#endif
LOG_FUNCTION_NAME_EXIT;