summaryrefslogtreecommitdiffstats
path: root/camera
Commit message (Collapse)AuthorAgeFilesLines
* Revert "CameraHal: Sync AF cancel with incoming OMX events"Eino-Ville Talvala2012-11-072-53/+23
| | | | | | This reverts commit b96dffd40e25d29a61f9fbd7f2e5968b5335b957. Bug: 7495861
* CameraHal: Sync AF cancel with incoming OMX eventsEmilian Peev2012-10-232-23/+53
| | | | | | | | | | | | | - Cancel AF is made to wait on incoming OMX events when AF status changes. An AF timeout is introduced in order not to block this call indefinitely. - Additionally calls to 'autoFocus()' will immediately trigger AF callbacks if fixed modes are being used. Bug: 6949572 Change-Id: I5f240fb6fc7fe53aecaff76d75d608dd522c1e27 Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* CameraHal: Avoid race condition during recording stopEmilian Peev2012-10-151-2/+2
| | | | | | | | | | | | | | | | - A race condition is possible when recording is stopped. 'BaseCameraAdapter::stopVideoCapture()' is clearing 'mVideoBuffersAvailable'. A delayed video frame from 'AppCallbackNotifier' can return afterwards though and then try to query the already empty 'KeyedVector'. This will result in a segfault. Solution is to move the vector reset away from 'stopVideoCapture()' and in to 'startVideoCapture()' where it is needed. Bug: 7021214 Change-Id: Ic234189b49e35c990b3af70bd713a12cb762362c Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* Fixup ion change to old libraryRebecca Schultz Zavin2012-07-091-1/+1
| | | | | | | Missed a few places that needed updating Change-Id: I1a483d9d85858e752df0f1d970559fcac6695856 Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
* Put back old ion libraryRebecca Schultz Zavin2012-06-282-2/+3
| | | | | | | Non-backwards compatible changes are being made to the version in system core Change-Id: I66d5119fb28a7eb3dc6cb9f7cbd1a8a8d902f290 Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
* CameraHal: Avoids possible race conditions while accessing 'mParams'Emilian Peev2012-05-237-91/+84
| | | | | | | | | | | | | - Direct access of 'mParams' outside of 'get-/setParameters()' should be avoided. The underlying strings can get invalidated with each call to 'setParameters()', which can lead to instabilities. - This change also removes legacy stereo code, which is not used any more. Bug: 6509329 Change-Id: Ief6df206c33fbdc666644cea8630e0bce6a36c00 Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* CameraHAL: Aligns UV planes during YV12 preview callbacksEmilian Peev2012-05-101-4/+28
| | | | | | | | | | - UV planes stride should be multiple of 16. The buffer size should also be updated accordingly. Bug: 6447707 Change-Id: If436801fbb2750523a3207878f611c8094667367 Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* CameraHal: Remove lock queries from 'mParams' during 'getParameters()'Emilian Peev2012-05-081-10/+16
| | | | | | | | | | - A race condition with 'set3ALock()' is possible, which can lead to a segfault during calls to 'getParameters()'. Bug: 6255665 Change-Id: Id64cf3ccfa1e47501d7ba0fb892f2f72329a2ad6 Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* CameraHal: Add support for YUY2 preview callbacksEmilian Peev2012-05-072-7/+46
| | | | | | | | | | | | | - The currently used Gralloc buffers for preview are limited to only NV12 pixelformat. In order to support this type of preview callbacks, CameraHal will internally convert from NV12 to YUY2. Bug: 6419136 Change-Id: I879e32d4b2142bdd0a1f89fe7c5496d250039b73 Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* CameraHal: Do full AF sweep during lost AF statusEmilian Peev2012-05-042-8/+10
| | | | | | | | | | | | - Previously only "OMX_FocusStatusUnableToReach" status was activating the full AF scan. Currently with CAF callbacks updates in Ducati, this is no longer the case and "OMX_FocusStatusLost" should be considered as well. Bug: 6378194 Change-Id: Ib296c6d7197cd275a9e5106f791451f4179be3e9 Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* CameraHal: Fix for YV12 camera callbacksEmilian Peev2012-04-291-3/+7
| | | | | | | | | | - 'mPreviewPixelFormat' was being set incorrectly for YV12 case. Bug: 6325348 Change-Id: I80acc5cd721d317fac9525bdb734fe2e70df85bf Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* CameraHAL: Fix for CTS test #testFocusDistancesEmilian Peev2012-04-111-0/+2
| | | | | | | | | | | | | | - The 'focusStatus' variable in 'doAutoFocus()' is uninitialized in the case where the camera client sets focus lock in CAF mode. Depending on the current stack content this method might try to set CAF focus again and wait for a focus callback, which will inevitably timeout. - Fix for random fails during CTS test #testFocusDistances. Change-Id: Iafa84bbf5b7119d77f1f666a6a88c613b657541e Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* CameraHal: Speedup face detection startEmilian Peev2012-03-233-10/+16
| | | | | | | | | | | | | | | | - Currently when face detection gets enabled the face priority for AE and AF is getting configured as well. This configuration takes around 18 ms. on average and can delay the overall startup time. The optimization will move the algo setup away from face detection enablement and in to the FillBufferDone callback. Bug: 5488236 Change-Id: I2b0e8df9fdead7a5d761a1efbcbf57d39e27ae3c Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* camera: fix deadlock because of mStateSwitchLockTyler Luu2012-03-232-2/+18
| | | | | | | | | | | When OMXCameraAdapter::UseBuffersPreview() is failing mStateSwitchLock must be unlocked. b/6046798 Change-Id: Ie9ecccc2e23b0a31b2972beb0411faca279d5d0c Signed-off-by: Daniel Levin <dendy@ti.com> Signed-off-by: Tyler Luu <tluu@ti.com>
* camera: prevent possible deadlock scenarioTyler Luu2012-03-232-4/+7
| | | | | | | | | | | | | | | Hold scope of returnFrame lock for just the calculation of refCount. Otherwise, we could have a scenario where endImageCapture and stopRecording could cause a deadlock competing for mReturnFrameLock and mLock. Issue arises mainly because endImageCapture is signalled from fillThisBuffer which stopRecording will need to get into. Make sure mEventQ has a message before calling get() since read on the pipe will block with notifyEvent holding mLock. Change-Id: I3a125711632fa311fd794e300cd5008321a84c40 Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHal: Remove excessive focus mode configurationsEmilian Peev2012-03-232-8/+7
| | | | | | | | | | | | - This change should improve overall stability during image capture. Configuring focus mode while image capture is active is always going to result in 'OMX_ErrorBadParameter'. Bug: 6026480 Change-Id: I735c5d25adc293d163f77488c0dc6d30a636544b Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* CameraHal: Don't signal off AF status events to 'doAutoFocus()'Emilian Peev2012-03-231-1/+2
| | | | | | | | | | | | - In dark lighting conditions and when AF assist is active sometimes the OMX camera component changes the AF status to off and generates and OMX event. Currently this is being interpreted as cancel AF. Bug: 6197932 Change-Id: Ibddd0033eecd186c1bfc90530af651f1c0223a25 Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* Merge "CameraHal: Omit 'apply3Adefaults()' during initialization"Wu-cheng Li2012-03-133-37/+4
|\
| * CameraHal: Omit 'apply3Adefaults()' during initializationEmilian Peev2012-03-133-37/+4
| | | | | | | | | | | | | | | | | | | | - This change should improve the standby to first shot PPM bug:6136966 Signed-off-by: Emilian Peev <epeev@mm-sol.com> Change-Id: I20ffd1178a64b77d45b35bac1cf04be21d2d602b
* | Merge "CameraHal: Cuts down execution time of 'get-/setParameters()'"Wu-cheng Li2012-03-135-147/+228
|\ \ | |/
| * CameraHal: Cuts down execution time of 'get-/setParameters()'Emilian Peev2012-03-135-147/+228
| | | | | | | | | | | | | | | | | | | | | | - The change utilizes two approaches: Wrap unused parameters in 'OMAP_ENHANCEMENT' macro. Minimize usage of CameraParameters. bug:6136966 Change-Id: Ie4a4d2f007e6571ee9a403ed68e977d6cbf6756b Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* | Switched to use header files from /frameworks/nativeJames Dong2012-03-121-1/+2
|/ | | | | | o related-to-bug: 6044887 Change-Id: I45362c0a68f49684e0393fc77ab4d5f55ec53716
* fix hardcoded include pathsMathias Agopian2012-03-051-2/+0
| | | | Change-Id: Idda63f9af654bf136755efc38e7bb50ba6f8ca24
* remove dependency on android_native_buffer.hMathias Agopian2012-02-241-1/+0
| | | | Change-Id: I7af0a5054b91a771ea9e77fd052ab5fd921ba78e
* Update includes for ion helper libraryRebecca Schultz Zavin2012-02-222-2/+1
| | | | | | | | libion is being moved to system/core. Update the includes to reflect the change. Change-Id: If94feb9b89ff1f6c8f55303ba610d3c39c8d80d8 Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
* CameraHal: Workaround for delayed AF eventsEmilian Peev2012-02-141-14/+18
| | | | | | | | | | | | | | | | Addresses a corner case with b/5534973 - If the OMX Camera component delays ( for whatever reason ) the AF status notification during cancelAF, then there is a chance that the AF callback timeout inside 'doAutoFocus()' might expire and an incorrect failed AF callback might be generated to the client. What this change does is to immediately unblock the thread waiting for AF status after the configuration for stopping AF. This way we are effectively skipping the wait on the OMX component. Change-Id: Ieda419b3ceee20eee80b543a00cd59b8f51d1cbe Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* CameraHal: Reduces Camera logcat printsEmilian Peev2012-02-114-12/+18
| | | | | Change-Id: Id32ad1b882a76f091866583b15ae0ca2929bacef Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* CameraHal: Various AF related fixesEmilian Peev2012-02-113-30/+24
| | | | | | | | | | | | | - In case of AF timeout the focus callback was being disabled. This callback will not get re-enabled again until preview is restarted. - Cancel AF is not working properly. Depending on the timing the off status event might not reach 'doAutoFocus()'. - This change also replaces the 'mDoAFSem' semaphore with a condition variable. Change-Id: I2ab7d87a05d97435aa6e67a122cc37a975794fc2 Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* CameraHal: Avoid possible segfaults in 'setExtraData()'Emilian Peev2012-02-111-1/+2
| | | | | | | | | | | - There is a chance that the OMX component could get released while 'startImageCapture()' is still waiting for the shutter callback. In this case we should omit the extra data configuration. - Should fix bug: 5911295 Change-Id: I82344573e56d7b58f119f68905e2fa1eaa3d69fe Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* CameraHal: Implementation for CAF status callbacksTyler Luu2012-02-018-46/+141
| | | | | | | | | | | | | | | | | | 1. Remove internal handling of CAMERA_MSG_FOCUS. Before we were enabling CAMERA_MSG_FOCUS only when application calls autoFocus(). No longer needed since the CAMERA_MSG_FOCUS can come just during preview now. 2. Add handling of unregistered focus callbacks. Since OMXCamera will send callbacks even when we are not waiting for one, add some handling. Signed-off-by: Tyler Luu <tluu@ti.com> Change-Id: I457e67b33b2561dd0b1ce3863ce807a8c27f79f6 Conflicts: camera/OMXCameraAdapter/OMXFocus.cpp
* CameraHal: Fix timing issue with focus msg disableTyler Luu2012-02-011-2/+2
| | | | | | | | | | Disable focus message before sending notification because client can immediately call focus again after receiving notification and before we get a chance to disable the message. This will result in the focus notificiation for the subsequent focus call to be missed. Change-Id: I1367cdcebe490c32251e992b87ada3edf6b28036 Signed-off-by: Tyler Luu <tluu@ti.com>
* Prevent duplicate DateTime tags in EXIF.Angus Kong2012-01-192-6/+4
| | | | | bug:5766177 Change-Id: Ib60030374ffca8e27c814503621cc545f9132360
* Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-089-29/+29
| | | | | | | See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: I7d131473964d92c62a495d082a1207867f435885
* Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGESteve Block2012-01-051-1/+1
| | | | | | | See https://android-git.corp.google.com/g/157065 Bug: 5449033 Change-Id: I71aea6795e3ed22beacb9a8f5774499e96c69a4d
* Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGESteve Block2012-01-041-1/+1
| | | | | | | See https://android-git.corp.google.com/g/156801 Bug: 5449033 Change-Id: Ib3b6ce6a89755e29aa9f830e9185064c25dd138e
* Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block2012-01-033-5/+5
| | | | | | | See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: I551e5a040249a8908251cd8c8d7131287f1f53de
* am 3500401f: am 82a05e51: Use local time in EXIF.Angus Kong2011-12-141-2/+2
|\ | | | | | | | | * commit '3500401fabe4e4ce8f9e6e1cc503fdc87b3a2222': Use local time in EXIF.
| * Use local time in EXIF.Angus Kong2011-12-141-2/+2
| | | | | | | | | | | | | | UTC is only used in GPS time stamp and local time is used in other date/time field. bug: 5757809 Change-Id: I8c728dca9db003c6a750df300d993e3615ef71c8
| * CameraHAL: Fixes a couple of corner cases with AF and capture DO NOT MERGEAkwasi Boateng2011-12-012-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes b/5627968. On some occasions during monkey tests, both the AF callback and the shutter callback can be delayed just enough to encounter the OMX component in loaded state. Usually this happens when the camera is getting closed and this scenario should be properly handled by exiting immediately without trying to trigger any callbacks to the client. Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com> Change-Id: Ia18faf471a8e10579b09973178d73e69e782c63c
* | CameraHal: Add missing null check in OMX3ATyler Luu2011-12-121-2/+2
| | | | | | | | | | | | | | | | | | Check for null before strcmp b/5639860 Change-Id: I552213c9894679eeb64cd06419f3f430276b273e Signed-off-by: Tyler Luu <tluu@ti.com>
* | CameraHal: Fix preview not starting after surface is abdandonedTyler Luu2011-12-052-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If an application gets backgrounded (HOME key) without stopping preview and releasing camera, preview would previously not restart when application is resumed. ANativeWindowDisplayAdapter would detect that the preview surface was abandoned and stop sending buffers to CameraAdapter. We were previously not doing anything when CameraService called setPreviewWindow when a display adapter was already created. To fix this issue, we need to send the preview window and restart preview. Change-Id: I36089b0046f9861897d32c50b52128a41e2de2a5 Signed-off-by: Tyler Luu <tluu@ti.com>
* | CameraHAL: Prevent deadlock in AppCallbackNotifier::stop()Tyler Luu2011-12-022-25/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a small chance that a stopPreview call can come from CameraService right around the same time Encoder thread will send a data callback for the video snapshot. Currently, we are waiting for the encoder thread to join in AppCallbackNofier:: stop(), so we could deadlock if CameraService locks in lockIfMessageWanted for the video snapshot. Instead of waiting for Encoder thread to join, we can make cancel() block until Encoder thread is done canceling the encode. After cancel() returns, we can free up the cookies that we passed to it, so Encoder thread does not need to call the callback function to AppCallbackNotifier. Change-Id: Ib453d49d91077925b143c812d43a7d1b782c181c Signed-off-by: Iliyan Malchev <malchev@google.com>
* | CameraHAL: Exit Appcallback thread immediately.Akwasi Boateng2011-12-011-1/+2
| | | | | | | | | | | | | | | | | | Allow appcallback thread to exit immediately when exit command is processed. Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com> Change-Id: I83db309cf973e1ce9494c855430897a0c41704d8
* | CameraHAL: Fixes a couple of corner cases with AF and captureAkwasi Boateng2011-12-012-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - On some occasions during monkey tests, both the AF callback and the shutter callback can be delayed just enough to encounter the OMX component in loaded state. Usually this happens when the camera is getting closed and this scenario should be properly handled by exiting immediately without trying to trigger any callbacks to the client. Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com> Change-Id: Ia18faf471a8e10579b09973178d73e69e782c63c Signed-off-by: Iliyan Malchev <malchev@google.com>
* | CameraHAL: Handling OMX initializationAkwasi Boateng2011-12-012-39/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | Additional mOmxInitialized flag has been added to track whether OMX has been succesfully initialized to prevent duplicate OMX_DeInit() in OMXCameraAdapter destructor. Signed-off-by: Daniel Levin <x0155538@ti.com> Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com> Change-Id: I269c5ac9d5de3f3e9088a11a3bea7127c1bd79de
* | CameraHAL: Avoids a possible deadlock in AppCallbackNotifierAkwasi Boateng2011-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 'disableMsgType()' was querying CameraHal for enabled message types through 'msgTypeEnabled()'. This method will lock 'mLock' in CameraHal. On the other hand 'takePicture()' inside CameraHal will also lock 'mLock' before execution. If preview callbacks are enabled before image capture, then 'takePicture()' will call AppCallbackNotifier's 'disableMsgType()', which will try to lock 'mLock' again. Solution, a query to CameraHal for enabled message types is not needed inside 'disableMsgType()' because the passed argument 'msgType' already contains all the needed information. Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com> Change-Id: Ia4b7634ce21b8243f08d9124823c77e6bde84a8d
* | CameraHAL: Small fix in FD error handlingAkwasi Boateng2011-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | - 'detectFaces()' should return immediately if there is a mismatch in the 'platformPrivate' size. Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Vicky Martinez-DeFrain <a0869710@ti.com> Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com> Change-Id: Ib4237acdec7fa08dd4b06529e358003783dccf0a
* | CameraHAL: Fixes a small crop issueAkwasi Boateng2011-12-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - The offset variables 'mXOff' and 'mYOff' in ANativeDisplayAdapter are always initialized to zero. If the offset of the incoming preview buffer is zero and the viewable preview resolution is smaller than the actual preview buffer resolution, then the crop will not get configured properly. Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Vicky Martinez-DeFrain <a0869710@ti.com> Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com> Change-Id: Ib321f17566d253dd65dc4c6d20bf748a9a4c614b
* | CameraHAL: Removes a possible resource leak inside MemoryManagerAkwasi Boateng2011-12-012-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | - 'mIonFd' doesn't get properly closed in each error case involving buffer allocation Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Daniel Levin <x0155538@ti.com> Signed-off-by: Jean Johnson <a0271255@ti.com> Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com> Change-Id: Ib893e832712e3ea4a3711153453f7a2aa873d0ee
* | CameraHAL: Fixed line endings and file attributesAkwasi Boateng2011-12-017-1149/+1149
| | | | | | | | | | | | | | | | | | | | | | | | Replaced line endings to UNIX in CameraHAL-related sources. No code changes. Signed-off-by: Daniel Levin <x0155538@ti.com> Signed-off-by: Jean Johnson <a0271255@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com> Change-Id: Id32c429fe7527342cfa2a7b9b1724e5f088dbd3f