summaryrefslogtreecommitdiffstats
path: root/camera/inc
Commit message (Collapse)AuthorAgeFilesLines
* Revert "CameraHal: Sync AF cancel with incoming OMX events"Eino-Ville Talvala2012-11-071-4/+0
| | | | | | This reverts commit b96dffd40e25d29a61f9fbd7f2e5968b5335b957. Bug: 7495861
* CameraHal: Sync AF cancel with incoming OMX eventsEmilian Peev2012-10-231-0/+4
| | | | | | | | | | | | | - 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: Avoids possible race conditions while accessing 'mParams'Emilian Peev2012-05-232-1/+7
| | | | | | | | | | | | | - 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: Speedup face detection startEmilian Peev2012-03-231-0/+1
| | | | | | | | | | | | | | | | - 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>
* CameraHal: Omit 'apply3Adefaults()' during initializationEmilian Peev2012-03-131-1/+1
| | | | | | | | | | - This change should improve the standby to first shot PPM bug:6136966 Signed-off-by: Emilian Peev <epeev@mm-sol.com> Change-Id: I20ffd1178a64b77d45b35bac1cf04be21d2d602b
* remove dependency on android_native_buffer.hMathias Agopian2012-02-241-1/+0
| | | | Change-Id: I7af0a5054b91a771ea9e77fd052ab5fd921ba78e
* CameraHal: Various AF related fixesEmilian Peev2012-02-111-1/+3
| | | | | | | | | | | | | - 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: Implementation for CAF status callbacksTyler Luu2012-02-013-4/+12
| | | | | | | | | | | | | | | | | | 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
* Prevent duplicate DateTime tags in EXIF.Angus Kong2012-01-191-1/+2
| | | | | bug:5766177 Change-Id: Ib60030374ffca8e27c814503621cc545f9132360
* Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-081-2/+2
| | | | | | | See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: I7d131473964d92c62a495d082a1207867f435885
* 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
* CameraHAL: Prevent deadlock in AppCallbackNotifier::stop()Tyler Luu2011-12-021-3/+19
| | | | | | | | | | | | | | | | | | 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: Handling OMX initializationAkwasi Boateng2011-12-011-0/+1
| | | | | | | | | | | | | 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: Removes a possible resource leak inside MemoryManagerAkwasi Boateng2011-12-011-1/+1
| | | | | | | | | | | | | - '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-014-629/+629
| | | | | | | | | | | | 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
* am 67496a60: am 3ffd5d43: Merge changes I0878a9f8,I1011252e into ics-mr1Iliyan Malchev2011-11-301-0/+2
|\ | | | | | | | | | | * commit '67496a60c60076166f6856431f68024a9412c067': CameraHAL: Perform focus even if CAF has failed CameraHAL: Enable LDCNSF for Video snapshot
| * CameraHAL: Enable LDCNSF for Video snapshotMilen Mitkov2011-11-301-0/+2
| | | | | | | | | | | | | | | | | | 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>
* | CameraHal: Add more Exif data for video snapshotTyler Luu2011-11-222-1/+21
|/ | | | | | | | | | | | 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>
* CameraHAL: clean up logsIliyan Malchev2011-11-171-0/+2
| | | | | | | | | | -- introduce CAMHAL_LOGI so that we don't have to dump informational messages as LOGE -- convert some verbose messages to CAMHAL_LOGDB -- convert most frequent non-error log messages to CAMHAL_LOGI Change-Id: I8afc24aa17da2c157b7b37300a79b4cde81f87e5 Signed-off-by: Iliyan Malchev <malchev@google.com>
* CameraHAL: Do not return error if AF failsIliyan Malchev2011-11-171-5/+6
| | | | | | | | | | | | | | | | | Fixes b/5612881 Some third-party apps do not handle errors thrown by the camera HAL when they try to invoke autoFocus while AF is in progress. The Barcode Scanner, in particular, will quit in this case without releasing the Camera handle, wreaking all sorts of power-management havoc. Even though CTS does not mandate it, previous versions of Android and other camera HAL implementations simply return success in this case. This patch makes this HAL conform to this behavior. Change-Id: I758e2de7f84b61043267f052169068b64d75d0d1 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHAL: Clear events queue fix, clear command queue on exitSundar Raman2011-11-101-0/+16
| | | | | | | | | | | | | | | Fix 2/3 for b/5593964. 1. The events queue wasn't being cleared correctly inside OMXCameraAdapter as some items were being removed while the index was being formulated based on the original size 2. The command queue should be cleared before posting the EXIT message for the OMX adapter threads so as not to process those messages since we are exiting Change-Id: I0a5eaceb3d1504fee05b064ebb5fe888e129ad44 Signed-off-by: Sundar Raman <sunds@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* CameraHAL: Fixes for ANR and a setParameter issueSundar Raman2011-11-101-4/+2
| | | | | | | | | | | | | | | Fix 1/3 for b/5593964. 1. Ensure we don't race with stopImageCapture when stopPreview is called 2. Signal the shutter callback correctly 3. Do not crash the media server if focus APIs and image capture returns error Still go ahead and perform de-init 4. Replace setParameter from CameraHAl to AppCallbackNotifier with getParameter when needed. Change-Id: I2b2745827d227a8d7927ce1611a84c29129e8891 Signed-off-by: Sundar Raman <sunds@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* CameraHal: Add function to rollback state machineTyler Luu2011-11-072-0/+7
| | | | | | | | | | | | Fix 1/3 for b/5472396. Adding a function to rollback the state machine to INTITIALIZED_STATE from any given current state. With this function, we can better manage the different states that CameraAdapter could be in when stopPreview is called. Change-Id: I0a456738e8575873b5ac6fb2a31395dab54ef6f7 Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHAL: Use Ancillary data to check for snapshotMilen Mitkov2011-10-311-0/+2
| | | | | | | | | | | | | Uses the ancilary data field nDCCStatus to check if the preview frame is a snapshot. Fixes a rare issue in which a normal (non-snapshot) preview frame is received after capture has started. Change-Id: I242c17ee3dd1365eb24c6c15585bb125f6938dee Signed-off-by: Milen Mitkov <mmitkov@mm-sol.com> related-to-bug: 5472396
* Remove non-(calibrated, api, or verified) 3A settingsTyler Luu2011-10-271-5/+10
| | | | | | | Change-Id: I16aaafeb43a0799cf12d97979709524e3b0fc933 Signed-off-by: Tyler Luu <tluu@ti.com> related-to-bug: 5472533
* CameraHal: Fixes for #testFocusDistanceTyler Luu2011-10-262-1/+3
| | | | | | | | | | | | | | | | | | | | 1. Seperate OMXCameraAdapter cancelAutoFocus with unsetting focus lock. Adding new internal parameter to unlock focus from the cancelAutoFocus in CameraHal. We need to cancel auto focus during stop preview in case it is still running. If we do the unlock in OMXCameraAdapter then, focus distance can change after stopPreview. 2. If autoFocus or takePicture comes after startPreview but before the first preview frame comes, then sometimes the focus distance queried after the calls won't be correct since OMX camera might still be transitioning. 3. Update focus distances when focus is running. b/5473673 Change-Id: I5a27d78aef437a1601a68e8c08fa860f04fc0c55 Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHal: Remove non-API 3A settingsTyler Luu2011-10-251-19/+28
| | | | | | | b/5472533 Change-Id: I62ce16499c62e11a321c89872eec19d9d1eac635 Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHAL: WA for #testSceneModeTyler Luu2011-10-202-0/+253
| | | | | | | | | | testSceneMode requires parameters to be updated properly before starting preview. OMX Camera doesn't currently support this so we are just going to keep a hard-coded LUT for the scene modes for now. Change-Id: I40c4492834d43c9328c87fd7aa4ea06fb1f1d90b Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHAL: Fix for #testJpegExifSundar Raman2011-10-191-1/+2
| | | | | | | | | | | Set the focal length to correct defaults for primary and secondary for the sensors on the phone. Previous camerahal value was wrong. Call setupEXIF even in the case where we return from useBufferCapture when the port is already enabled. Change-Id: I224ec2f19af11de525455015c1822ba6a13c4d17 Signed-off-by: Sundar Raman <sunds@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* CameraHAL: Keep image port enabled if possibleTyler Luu2011-10-191-0/+1
| | | | | | | | | | | | | | | | | | | | Try to keep the image port enabled if possible after capturing an image. We need to disable the image port if any settings are changed or when stopping preview. To disable image port, buffers also have to be freed, and to keep the image port enabled, the same buffer needs to be used. So, we are reenabling functionality to trigger free the image buffer from camera adapter to free the buffer as late as possible and as required by camera adapter. Skip image buffer allocation if it is already enabled. Fixes issue with some jerks seen in preview during video capture while taking snapshot. b/5449158 Change-Id: I830cf8512fe039df10d28e1f5a22e61e30840852 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* CameraHAL: Make CAF mode APIs consistentTyler Luu2011-10-191-0/+3
| | | | | | | | | | | | | Make FOCUS_MODE_CONTINUOUS_VIDEO and FOCUS_MODE_CONTINUOUS_PICTURE consistent to the user. For us, this means we need to make some decision on which capture mode to select based on which CAF mode is selected by the application. b/5441086 Change-Id: I39e51ea916e1baa263b6dcc88f76a4940809ecb9 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* CameraHAL: protect mParameters3A from simultaneous read/write.Raji Reddy Kandi2011-10-191-0/+1
| | | | | | | | | | | | | Fix for Issue: Idle -> remove from the latest launched apps -> Launch Camera -> Settings -> Restore defaults -> ok -> Flash mode On -> White balance Cloudy -> Exposure -3 -> Scene mode Party -> Shooting -> Camcoder mode -> Settings -> Restore defaults -> ok ==> video preview is red even after we restored the settings. Change-Id: If4b3672693a092f1956708742a6cc5f2c2c284fb Signed-off-by: Raji Reddy Kandi <rajireddy.k@samsung.com>
* CameraHal: Share a lock for exec and loaded switchTyler Luu2011-10-181-1/+1
| | | | | | | | | | Share a lock between switchToLoaded function and doSwitchToExecuting, so the two don't try to switch state at the same time. b/5472446 Change-Id: I425943b97b7f08d1f7812214e4a305eb86af1ff9 Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHal: Fixes for #testVideoSnapshotTyler Luu2011-10-153-7/+8
| | | | | | | | | | | | | 1. Add raw notify callback for video snapshot 2. Add new state for video capture + AF 3. We were not populating focal length correctly for jhead. Need to send focal length as a rational in this format "xx/yy" 4. Need to send GPSProcessingMethod as an UNDEFINED ASCII to jhead b/5448171 Change-Id: Ie6be9ad821d1fa106d9c857681f2fa6427d4f283 Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHal: Enable 3A feedback for scene modesTyler Luu2011-10-152-1/+13
| | | | | | | | | When a scene mode is set by the application, some 3A parameters will be updated by Ducati. Feed these parameters back to the application. Change-Id: I07afec0315d2807470037388572d0bc7ee8c3ad8 Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHal: Adapt to new framework vstab paramTyler Luu2011-10-144-18/+11
| | | | | | | | change to use the new KEY_VIDEO_STABILIZATION parameter from the framework instead of using TICameraParameter definition. Change-Id: Ifed4c147e6ad3c02b35772343d9d339ab1402eac Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHAL: Restore zoom stages back to 60Sundar Raman2011-10-121-1/+1
| | | | | | | | | | This provides for a smooth zoom experience with immediate zoom This reverts commit a38ea5631d139c3d5ffd4e181df2216dbce1b10c. Fixes b/5251916 Change-Id: If1724ec2ad5d3106e10ee5c2e691f99c19675eaf
* CameraHAL: Pass zoom values smoothlySundar Raman2011-10-121-0/+1
| | | | | | | | | | | | | Update the zoom values to the ducati only in the fillBufferDone callback if another zoom request is already in progress. However, overwrite the zoom value with the latest value requested by the application Fixes b/5251916 Change-Id: I419baadb2ddd094277f003ddf25f63dca5d078f8 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHal: Fix issue with not setting 3A settingsTyler Luu2011-10-071-3/+3
| | | | | | | | Accidently redefined some of the values for 3A settings enum in 3a general settings header file. Change-Id: I84b72ae0516d0362d381c4fa1d597cae86571fd7 Signed-off-by: Tyler Luu <tluu@ti.com>
* GRALLOC_USAGE_EXTERNAL_DISP should not be used for CameraJames Dong2011-10-071-1/+0
| | | | | Change-Id: I0702a4b5fc35ef8435b1914b8e81f39b3e7ea0b4 related-to-bug: 5382682
* omap4xxx: camera: set capture settings only if changedTyler Luu2011-10-071-0/+11
| | | | | | | | | | | Partial fix for b/5371242 Only set capture configs when they have changed from our current setting to save some SetConfig time. Change-Id: I68d7b7ebd4be3273abd534ce8e939da62d38d481 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* omap4xxx: camera: only set CameraAreas if changedTyler Luu2011-10-071-1/+4
| | | | | | | | | | | | Partial fix for b/5371242 Add logic to compare areas for metering and focus before calling SetConfig for the respective indices so we only set the areas if the areas have changed Change-Id: Id6b55e3d8e78557f45b92a5afefdb8298450da61 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* omap4xxx: camera: switch to executing state when surface is nullAkwasi Boateng2011-10-073-1/+11
| | | | | | | | | | Partial fix for b/5422679 To enhance standby to first shot performance Change-Id: Ib32e8120a7908419c76e8cf2f1830f0667b258c0 Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* omap4xxx: camera: cancel and flush for SW JPEG encoderTyler Luu2011-10-071-6/+18
| | | | | | | | | | | | | | | | Fixes b/5378650 1. Add method to externally cancel Encoder class while in the middle of encoding. 2. Add queue in AppCallbackNotifier to track all the encoding sessions. When stopping AppCallbackNotifier if any encoding sessions are still ongoing, cancel and wait for the threads to return. Previously, it was possible for Encoder threads to still be running when the preview and images buffers were freed. Change-Id: Ib123d1644dfa7058a6f50f0001b4d05359853827 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* omap4xxx: camera: EXIF thumbnail for video snapshotTyler Luu2011-10-073-26/+53
| | | | | | | | | | | | | | | | | Fixes b/5370657 1) Extend NV12 resizer to take stride insteadof hardcoding stride 2) Change Encoder class interface to support encoding a thumbnail and main jpeg image. Encoder will resize/encodethumbnail in parallel while encoding the main jpeg. Only NV21/NV12 resizing is supported. Thumbnail is created withpost view frame. 3) Add interface in Encoder class to replace thumbnail with jhead. 4) Height and width fields of EXIF are not proper. Fixed. Change-Id: I5d0063357e4e9e327d22805c2dddf8f630d22e7b Signed-off-by: Raji Reddy Kandi<rajireddy.k@samsung.com> Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* omap4xxx: camera: send different preview and video buffers for MMS modeAkwasi Boateng2011-10-074-3/+178
| | | | | | | | | | | | | | | | | | Fixes b/5265389 b/5156090 1. Add support to send different preview and video buffers to framework in MMS mode. 2. For resolutions less than or equal to QVGA, preview resolution will be changed to a bigger resolution matching the aspect ratio of the preview resolution. 3. During record the changed resolution will be resized to the original resolution and sent to the encoder. 4. Modified NV12 resizer routine to account for frame offset and stride to avoid double memcpy of the buffers Change-Id: If66aa1fd861078d0a63b4a77a1bdc20d4c6bccda Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* CameraHal: Allow only certain number of instancesTyler Luu2011-10-074-5/+7
| | | | | | | | | | | | | | | | | 1) Protect against simultaneous access to camera_device_open 2) Set a value of MAX_SIMUL_CAMERAS_SUPPORTED to dictate number of simultaneous cameras that can be open at once. Set to 1 for now in this patch. Return error if more is requested. 3) Change OMXCameraAdapter to allocate new instance for each factory create call. 4) Add lock to capabalities factory function in OMXCameraAdapter to protected against multiple OMXCamera GetHandles... b/5401791 b/5404200 b/5405235 Change-Id: I179d493f8070d228877ebfac637047978afc7d55 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* Set EXIF maker and model to system properties.Wu-cheng Li2011-10-051-3/+9
| | | | | | | | | Set EXIF maker to ro.product.manufacturer and EXIF model to ro.product.model. bug:5404097 Change-Id: Ibeaa2225b2593ae7cdcbf75f85e1923095017db6
* CameraHAL: Improved error handling inside the adaptersSundar Raman2011-09-272-0/+7
| | | | | | | | | | | | | 1. unlock and cancel buffers to ANativeWindow when freeBuffers is called 2. Free the omx handle and deinitialize DOMX when errors occur while calling critical OMXCamera apis 3. Retry OMX_GetHandle if it fails to take care of error recovery scenarios. "Fixes b/5379663" Change-Id: I4729fab40e6104dfa6660ba6f6b1a90f805c2f59 Signed-off-by: Sundar Raman <sunds@ti.com>
* Make previous zoom index a member variableAkwasi Boateng2011-09-231-1/+1
| | | | | | | | | Change previous zoom index variable from static to member variable since variable is not reset when application is closed or during suspend resume. Change-Id: I7a757655dc7e5b30d21716dd38908f3d18131cde Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com>