summaryrefslogtreecommitdiff
path: root/camera
AgeCommit message (Collapse)Author
2012-05-23CameraHal: Avoids possible race conditions while accessing 'mParams'Emilian Peev
- 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>
2012-05-10CameraHAL: Aligns UV planes during YV12 preview callbacksEmilian Peev
- 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>
2012-05-08CameraHal: Remove lock queries from 'mParams' during 'getParameters()'Emilian Peev
- 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>
2012-05-07CameraHal: Add support for YUY2 preview callbacksEmilian Peev
- 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>
2012-05-04CameraHal: Do full AF sweep during lost AF statusEmilian Peev
- 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>
2012-04-29CameraHal: Fix for YV12 camera callbacksEmilian Peev
- 'mPreviewPixelFormat' was being set incorrectly for YV12 case. Bug: 6325348 Change-Id: I80acc5cd721d317fac9525bdb734fe2e70df85bf Signed-off-by: Emilian Peev <epeev@mm-sol.com>
2012-04-11CameraHAL: Fix for CTS test #testFocusDistancesEmilian Peev
- 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>
2012-03-23CameraHal: Speedup face detection startEmilian Peev
- 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>
2012-03-23camera: fix deadlock because of mStateSwitchLockTyler Luu
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>
2012-03-23camera: prevent possible deadlock scenarioTyler Luu
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>
2012-03-23CameraHal: Remove excessive focus mode configurationsEmilian Peev
- 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>
2012-03-23CameraHal: Don't signal off AF status events to 'doAutoFocus()'Emilian Peev
- 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>
2012-03-13Merge "CameraHal: Omit 'apply3Adefaults()' during initialization"Wu-cheng Li
2012-03-13Merge "CameraHal: Cuts down execution time of 'get-/setParameters()'"Wu-cheng Li
2012-03-13CameraHal: Omit 'apply3Adefaults()' during initializationEmilian Peev
- This change should improve the standby to first shot PPM bug:6136966 Signed-off-by: Emilian Peev <epeev@mm-sol.com> Change-Id: I20ffd1178a64b77d45b35bac1cf04be21d2d602b
2012-03-13CameraHal: Cuts down execution time of 'get-/setParameters()'Emilian Peev
- 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>
2012-03-12Switched to use header files from /frameworks/nativeJames Dong
o related-to-bug: 6044887 Change-Id: I45362c0a68f49684e0393fc77ab4d5f55ec53716
2012-03-05fix hardcoded include pathsMathias Agopian
Change-Id: Idda63f9af654bf136755efc38e7bb50ba6f8ca24
2012-02-24remove dependency on android_native_buffer.hMathias Agopian
Change-Id: I7af0a5054b91a771ea9e77fd052ab5fd921ba78e
2012-02-22Update includes for ion helper libraryRebecca Schultz Zavin
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>
2012-02-14CameraHal: Workaround for delayed AF eventsEmilian Peev
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>
2012-02-11CameraHal: Reduces Camera logcat printsEmilian Peev
Change-Id: Id32ad1b882a76f091866583b15ae0ca2929bacef Signed-off-by: Emilian Peev <epeev@mm-sol.com>
2012-02-11CameraHal: Various AF related fixesEmilian Peev
- 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>
2012-02-11CameraHal: Avoid possible segfaults in 'setExtraData()'Emilian Peev
- 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>
2012-02-01CameraHal: Implementation for CAF status callbacksTyler Luu
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
2012-02-01CameraHal: Fix timing issue with focus msg disableTyler Luu
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>
2012-01-19Prevent duplicate DateTime tags in EXIF.Angus Kong
bug:5766177 Change-Id: Ib60030374ffca8e27c814503621cc545f9132360
2012-01-08Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block
See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: I7d131473964d92c62a495d082a1207867f435885
2012-01-05Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGESteve Block
See https://android-git.corp.google.com/g/157065 Bug: 5449033 Change-Id: I71aea6795e3ed22beacb9a8f5774499e96c69a4d
2012-01-04Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGESteve Block
See https://android-git.corp.google.com/g/156801 Bug: 5449033 Change-Id: Ib3b6ce6a89755e29aa9f830e9185064c25dd138e
2012-01-03Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block
See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: I551e5a040249a8908251cd8c8d7131287f1f53de
2011-12-14am 3500401f: am 82a05e51: Use local time in EXIF.Angus Kong
* commit '3500401fabe4e4ce8f9e6e1cc503fdc87b3a2222': Use local time in EXIF.
2011-12-14Use local time in EXIF.android-sdk-4.0.3-tools_r1android-cts-verifier-4.0_r1android-cts-verifier-4.0.3_r1android-cts-4.0.3_r2android-cts-4.0.3_r1ics-mr1Angus Kong
UTC is only used in GPS time stamp and local time is used in other date/time field. bug: 5757809 Change-Id: I8c728dca9db003c6a750df300d993e3615ef71c8
2011-12-12CameraHal: Add missing null check in OMX3ATyler Luu
Check for null before strcmp b/5639860 Change-Id: I552213c9894679eeb64cd06419f3f430276b273e Signed-off-by: Tyler Luu <tluu@ti.com>
2011-12-05CameraHal: Fix preview not starting after surface is abdandonedTyler Luu
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>
2011-12-02CameraHAL: Prevent deadlock in AppCallbackNotifier::stop()Tyler Luu
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>
2011-12-01CameraHAL: Fixes a couple of corner cases with AF and capture DO NOT MERGEAkwasi Boateng
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
2011-12-01CameraHAL: Exit Appcallback thread immediately.Akwasi Boateng
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
2011-12-01CameraHAL: Fixes a couple of corner cases with AF and captureAkwasi Boateng
- 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>
2011-12-01CameraHAL: Handling OMX initializationAkwasi Boateng
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
2011-12-01CameraHAL: Avoids a possible deadlock in AppCallbackNotifierAkwasi Boateng
- '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
2011-12-01CameraHAL: Small fix in FD error handlingAkwasi Boateng
- '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
2011-12-01CameraHAL: Fixes a small crop issueAkwasi Boateng
- 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
2011-12-01CameraHAL: Removes a possible resource leak inside MemoryManagerAkwasi Boateng
- '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
2011-12-01CameraHAL: Fixed line endings and file attributesAkwasi Boateng
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
2011-11-30am 67496a60: am 3ffd5d43: Merge changes I0878a9f8,I1011252e into ics-mr1Iliyan Malchev
* commit '67496a60c60076166f6856431f68024a9412c067': CameraHAL: Perform focus even if CAF has failed CameraHAL: Enable LDCNSF for Video snapshot
2011-11-30CameraHAL: Perform focus even if CAF has failedMilen Mitkov
Fixes b/5534973 Used to force focus if CAF has failed (before capture). CAF's state is 'failed' even if a scene change is detected only. Change-Id: I0878a9f862b7800b566e578efdfa62baec7e5889 Signed-off-by: Milen Mitkov <mmitkov@mm-sol.com>
2011-11-30CameraHAL: Enable LDCNSF for Video snapshotMilen Mitkov
Enables LDCNSF for Video snapshot, also adds start_offset and right_crop fields to the JPEG encoder wrapper, because the image with LDCNSF has artifacts on top and right. Change-Id: I1011252e3f8068083f9d057b7763b7f79c59a75d Signed-off-by: Milen Mitkov <mmitkov@mm-sol.com>
2011-11-22CameraHal: Add more Exif data for video snapshotTyler Luu
Fixes b/5582076. Requires changes to Ducati and external/jhead. 1. Add API to get and set ancillary data metadata so we can use the values to fill in Exif data. 2. Add support for additional tags. Change-Id: I537e683839c59e92a4a20ff62653b6d46e303f53 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-11-18am 089c480c: am d31eec66: am 0bb54549: Ignore camera.flash_off system ↵James Dong
property for user build * commit '089c480c4e657653673854f0e3d92faa0fec75a5': Ignore camera.flash_off system property for user build