summaryrefslogtreecommitdiffstats
path: root/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* CameraHal: Various AF related fixesEmilian Peev2012-02-111-1/+0
| | | | | | | | | | | | | - 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-011-0/+20
| | | | | | | | | | | | | | | | | | 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
* Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-081-3/+3
| | | | | | | See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: I7d131473964d92c62a495d082a1207867f435885
* Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block2012-01-031-1/+1
| | | | | | | See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: I551e5a040249a8908251cd8c8d7131287f1f53de
* CameraHAL: Handling OMX initializationAkwasi Boateng2011-12-011-39/+39
| | | | | | | | | | | | | 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
* am 67496a60: am 3ffd5d43: Merge changes I0878a9f8,I1011252e into ics-mr1Iliyan Malchev2011-11-301-0/+1
|\ | | | | | | | | | | * 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/+1
| | | | | | | | | | | | | | | | | | 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-221-13/+47
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | am 8d18af6d: am e4639448: CameraHAL: clean up logsIliyan Malchev2011-11-171-4/+4
|\| | | | | | | | | * commit '8d18af6dfd68f047c2bcf82fe88eeeb623eafa0c': CameraHAL: clean up logs
| * CameraHAL: clean up logsIliyan Malchev2011-11-171-4/+4
| | | | | | | | | | | | | | | | | | | | -- 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>
* | am 8a2c7a2d: am 8eedae16: am 50f5c8a3: CameraHal: WA for green thumbnail for ↵Tyler Luu2011-11-101-1/+5
|\| | | | | | | | | | | | | video snapshot * commit '8a2c7a2d44408aea33beef1775c7b925211d1aae': CameraHal: WA for green thumbnail for video snapshot
| * CameraHal: WA for green thumbnail for video snapshotTyler Luu2011-11-101-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | WA for regression introduced with: 'cf0a61f135: CameraHAL: Use Ancillary data to check for snapshot" Video snapshot postview frames are not currently being tagged with the ancillary data. Let this check pass through when in video mode. Change-Id: I9b3aacb902d15f1cd7f993f6664976299fcb0427 Signed-off-by: Tyler Luu <tluu@ti.com>
* | am fef08387: am 7e51020e: am f9df3ee5: CameraHAL: Clear events queue fix, ↵Sundar Raman2011-11-101-3/+13
|\| | | | | | | | | | | | | clear command queue on exit * commit 'fef083876a27ebab9451c0151ce6fbaae0f66ccf': CameraHAL: Clear events queue fix, clear command queue on exit
| * CameraHAL: Clear events queue fix, clear command queue on exitSundar Raman2011-11-101-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | am d3278ddd: am 977fc7e4: am 3ec18006: CameraHAL: Fixes for ANR and a ↵Sundar Raman2011-11-101-8/+0
|\| | | | | | | | | | | | | setParameter issue * commit 'd3278ddd57085e8d7f261defbdfaed4d5bbea167': CameraHAL: Fixes for ANR and a setParameter issue
| * CameraHAL: Fixes for ANR and a setParameter issueSundar Raman2011-11-101-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | am a7c06115: am efa626c4: am 956c27e3: CameraHal: Apply3aSettings at start ↵Vladislav Hristov2011-11-101-0/+1
|\| | | | | | | | | | | | | preview * commit 'a7c06115a023e4160d2ef922fc0930098642293c': CameraHal: Apply3aSettings at start preview
| * CameraHal: Apply3aSettings at start previewVladislav Hristov2011-11-091-0/+1
| | | | | | | | | | | | | | | | Fixes b/5515136. Change-Id: I3b462b337f42be7ebe07642f5298f45bb1431daa Signed-off-by: Vladislav Hristov <vhristov@mm-sol.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* | am 3c86a542: am fe3c9139: CameraHal: Wait for frame before stopping previewTyler Luu2011-11-071-0/+14
|\| | | | | | | | | * commit '3c86a5424fa4a0099d66172ff8b0a00eda9fd528': CameraHal: Wait for frame before stopping preview
| * CameraHal: Wait for frame before stopping previewTyler Luu2011-11-071-0/+14
| | | | | | | | | | | | | | | | | | | | | | Fix 3/3 for b/5472396. We should wait for the first frame to come before trying to stopPreview. If not, we might put OMXCamera in a bad state i.e (IDLE->LOADED timeout). Seeing this a lot after a capture Change-Id: I4ac6cc4f12bdc0d4d73e065b7c53caf8a440a43c Signed-off-by: Tyler Luu <tluu@ti.com>
* | am eb3ed8e7: am 3c272a99: CameraHAL: Return status after CAF finishesMilen Mitkov2011-11-021-3/+8
|\| | | | | | | | | * commit 'eb3ed8e75abbe8785b86a47851f4d7e98300006c': CameraHAL: Return status after CAF finishes
| * CameraHAL: Return status after CAF finishesMilen Mitkov2011-10-311-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | If the user initiates autofocus while CAF is scanning (e.g. when capturing), wait until CAF finishes and just then notify the focus subscribers. bug:5514415 Change-Id: I971783c74f9977755cc93cdba964e4fcd3a2ab0a Signed-off-by: Milen Mitkov <mmitkov@mm-sol.com>
* | am 9b4a3604: am cf0a61f1: CameraHAL: Use Ancillary data to check for snapshotMilen Mitkov2011-11-021-3/+54
|\| | | | | | | | | * commit '9b4a3604f53dbd3f41ee380fa1a041834490b688': CameraHAL: Use Ancillary data to check for snapshot
| * CameraHAL: Use Ancillary data to check for snapshotMilen Mitkov2011-10-311-3/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | am 0f2338c5: am 39ad5f81: CameraHal: Limit 1080p framerate maxTyler Luu2011-10-311-0/+6
|\| | | | | | | | | * commit '0f2338c555446e851e6290882db06a5418257a96': CameraHal: Limit 1080p framerate max
| * CameraHal: Limit 1080p framerate maxTyler Luu2011-10-281-0/+6
| | | | | | | | | | | | | | Change-Id: Ic02b60940f80d309f9a87b6e1307fbbdd0c592ff Signed-off-by: Tyler Luu <tluu@ti.com> related-to-bug: 5508276
* | am df6023f6: am fd705eb8: CameraHal: Fixes for #testFocusDistanceTyler Luu2011-10-261-11/+51
|\| | | | | | | | | * commit 'df6023f6fd9a515da9cec0e98ea303306b14c5d8': CameraHal: Fixes for #testFocusDistance
| * CameraHal: Fixes for #testFocusDistanceTyler Luu2011-10-261-11/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Rename LOGV(_IF) to ALOGV(_IF) DO NOT MERGESteve Block2011-10-251-1/+1
|/ | | | | | | See https://android-git.corp.google.com/g/#/c/143865 Bug: 5449033 Change-Id: Ic854588fa661ebcc63395c388bf98af268b709c7
* Fix for double OMX_Deinit() callsAkwasi Boateng2011-10-241-27/+28
| | | | | | | Change-Id: I43260d50a284a7d651b6309b344404bf45c7a617 Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> related-to-bug: 5451993
* CameraHAL: WA for #testSceneModeTyler Luu2011-10-201-0/+13
| | | | | | | | | | 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: Disable AF assist in stop previewSundar Raman2011-10-201-0/+17
| | | | | | | | | | | | If AF assist is ON when switching to video mode and flash is not set to OFF before switching, then the torch mode is somehow turned ON and never turns OFF. Since AF assist is not used after stopping preview, set it to OFF Change-Id: I44c9e6359a0488d235929f6bf1cdd4b257565caf Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHal: Select proper CAF mode for scene feedbackTyler Luu2011-10-191-1/+6
| | | | | | | | | | We were not choosing the right CAF mode during scene mode feedback because CAF video has precedence in the focus mode LUT. Adding some logic to select CAF picture if we are not if video mode. Change-Id: I98260dae04708d5d42248cbafa4adb57ce18221f Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHAL: Keep image port enabled if possibleTyler Luu2011-10-191-0/+6
| | | | | | | | | | | | | | | | | | | | 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: Recorded video has jerks with video snapshotTyler Luu2011-10-191-9/+6
| | | | | | | | | | | | | | | Avoid video frame drops during video snapshot. We were previously not sending the video frame to AppCallbackNotifier because the first frame after video snapshot was considered a snapshot (postview) frame. This patch sets the video frame mask regardless of preview or snapshot frame during recording b/5449158 Change-Id: Idaecbaa53686b81428a3d63ea95481f5b6eff23d 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>
* CameraHAL: Always reset focus mode after captureMilen Mitkov2011-10-191-0/+5
| | | | | | | | Workaround when doing many consecutive shots, CAF wasn't getting restarted. Change-Id: Ibef033535360dc534de2b761861f7e9c5e79aec2 Signed-off-by: Milen Mitkov <mmitkov@mm-sol.com>
* CameraHal: Only feedback supported paramsTyler Luu2011-10-181-3/+11
| | | | | | | | | | Check to see if the updated param from scene mode selection is supported before reporting it back to application in getParameters. Work-around for Ducati not always reporting supported 3A parameters for a particular scene mode. Change-Id: Idc05f150df081b1a2b6c841730da08713b64fd47 Signed-off-by: Tyler Luu <tluu@ti.com>
* Flash and WB are not restored in video mode when camera comes to foregroundHeechan Park2011-10-181-6/+8
| | | | | | | | | | | | | | Fixes b/5475271 1) Switch to video mode, enable Flash to ON 2) Press Power key, Flash is switched oFF 3) Press power key and open camera, Flash is Not switched ON. Fix: Updating the WB, Flash and Focus values only when Scenemode is active. Change-Id: I35f852c2611644e0115bbf12f5110d92374e6c90 Signed-off-by: Braganza Sam Roberts <sam.braganza@samsung.com> Signed-off-by: Heechan Park <heech.park@samsung.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* Camera HAL Optimizations for cold startup timeSundar Raman2011-10-181-10/+12
| | | | | | | | 1. Removes 100mS latency introduced in OMX_GetHandle 2. Calls apply3ASettings and advanceZoom after sending the callback to display (saves ~30mS) Change-Id: I58a1f81ede4439cd19587c8390681062792fb5a8 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHal: Share a lock for exec and loaded switchTyler Luu2011-10-181-7/+9
| | | | | | | | | | 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: Allow EV compensation w/ preset sceneTyler Luu2011-10-151-2/+0
| | | | | | | | CameraHal was previously ignoring EV compensation when a scene mode was set. Change-Id: I15023a5c6019ca333a4ce40f178a8e4ef53be387 Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHal: Enable 3A feedback for scene modesTyler Luu2011-10-151-121/+8
| | | | | | | | | 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>
* omap4xxx: camera: not an error when callback threads are already runningIliyan Malchev2011-10-131-1/+5
| | | | | | | | | | | | Potential fix for b/5431225 (if not, it will point in the right direction) -- When CallbackThread or OMXCallbackThread is already running during initialization(), do not treat this as an error. -- Print an error on logcat when the OMX component state is not as expected during intialization Change-Id: Icf7312e609a7a17ccaf412d3c3fe6a5075de00f7 Signed-off-by: Iliyan Malchev <malchev@google.com>
* CameraHAL: Pass zoom values smoothlySundar Raman2011-10-121-0/+2
| | | | | | | | | | | | | 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>
* omap4xxx: camera: set capture settings only if changedTyler Luu2011-10-071-0/+2
| | | | | | | | | | | 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: switch to executing state when surface is nullAkwasi Boateng2011-10-071-3/+130
| | | | | | | | | | 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>
* CameraHal: Allow only certain number of instancesTyler Luu2011-10-071-226/+177
| | | | | | | | | | | | | | | | | 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>
* CameraHAL: Improved error handling inside the adaptersSundar Raman2011-09-271-65/+89
| | | | | | | | | | | | | 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>
* CameraHal: Changes to releasing of focus lockTyler Luu2011-09-271-7/+0
| | | | | | | | | | Do not release focus lock during stopPreview and after takePicture. bug:5356404 Change-Id: Ib7078f5261ee21579143c4519896d1b13874697b Signed-off-by: Tyler Luu <tluu@ti.com>