summaryrefslogtreecommitdiffstats
path: root/camera/inc
Commit message (Collapse)AuthorAgeFilesLines
...
* CameraHal: Add metering area mutexTyler Luu2011-09-231-0/+1
| | | | | | | | | mMeteringAreas needs to be protected by a mutex so it's not cleared or modified while setting it Ducati. Change-Id: I0ca8f5e3b57b88b518a8e1ab22c442c21131e39c Signed-off-by: Tyler Luu <tluu@ti.com>
* OMXCameraAdapter: Update timstamp calculation and commentDevaraj Rangasamy2011-09-211-0/+2
| | | | | | | | | | | | In timestamp calculation, latency incurred in Ducati camera buffer reaching CameraHal should be considered Patchset 2: - Updated variable name, migrated to header file - Update comment description Change-Id: Icc93c27a66477867e9c415b139a331646eb2fba8 Signed-off-by: Devaraj Rangasamy <dev@ti.com>
* CameraHAL: CTS fixes related to #testMeteringAreasSundar Raman2011-09-211-3/+3
| | | | | | | | | | | | | | | | | | - The status of "parseAreas()" should always be checked in order to return proper error code in case of invalid input arguments. - If the input metering areas are more than the supported ones, then always return an error. - 'parseAreas()' expects the buffer size, not the string length. - Refactors "parseFocusAreas()' to the more general 'parseAreas()'. Change-Id: I4c70bcaa3c676f525b721916cc39c66db5e0fc17 Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHal: Add filter to smooth faces from OMXCameraTyler Luu2011-09-211-0/+4
| | | | | | | | | | | | | | Filter faces coming from Ducati to smooth out the jitter. This patch requires the face tracking mechanism in Ducati so faces are ordered properly for each frame. Also, this patch is only providing filtering of face sizes since Ducati is already smoothing the face positions. b/5141268 Change-Id: Ia7ee1c46ca41fcdd1e45505242f2802b0b4fb647 Orginal-author: Mandeep Kumar <mandeep@ti.com> Signed-off-by: Tyler Luu <tluu@ti.com>
* Grallock lock and unlock fixesAkwasi Boateng2011-09-212-2/+22
| | | | | | | | | | | 1. Get and store Y and UV pointers from all gralloc handles to be used for preview callback and video frames. 2. Ensure gralloc lock is successfull before frame return to OMXCameraAdapter Change-Id: Ibeea6d00f2c1a1c45bcd2eafb22b90a795516e5c Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com>
* CameraHal: Lock focus after AF completionTyler Luu2011-09-192-1/+3
| | | | | | | | | 1) Add API to use OMX_IndexConfigImageFocusLock to lock autofocus 2) Remove FIXME to always return true status when CAF is set Change-Id: Ie195206243bc1f750954def5f4f9f4466295bc7c b/5338488
* CameraHAL: Adds some useful debug logs on frame countsSundar Raman2011-09-191-0/+9
| | | | | Change-Id: Ifb1434f9fd1c85f040d67f3df6fb7c4a86e135db Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHAL: Fixes for FPS range configurationSundar Raman2011-09-193-3/+8
| | | | | Change-Id: Idfc506812d6e0f1d88bdc5d7d62c159f9c9ad642 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHal: Error handling before sending framesTyler Luu2011-09-171-0/+8
| | | | | | | | | | | | Adding a few error checks before sending frames to make sure we have the proper conditions to send a frame. Fixes a bug where FillBufferDone gets preempted by the stop path and by the time it returns the buffers and subscribers are freed. Adding checks in send frame context since it is protected by a Mutex. Change-Id: I860bee796669606e1ec3e26e19916f386fc3e9aa
* CameraHal: Ensure frames are returned by AppCallbackNotifierTyler Luu2011-09-161-0/+3
| | | | | | | | | | | | | | | No bug filed for this, but it results in a crash. We can say it's a partial fix for b/5316293 1. Clean-up notifyFrame a bit by using a common function to send data callbacks. This ensures common functionality for the all frame types. 2. Flush all the frames after stopping AppCallbackNotifier to ensure notifyFrame doesn't operate on the buffers. Change-Id: I4b0c8a595ea5474e8c8f5f98cfee16e6c1bde949 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* CameraHal: Fixes for setParameter in CameraHalTyler Luu2011-09-141-0/+1
| | | | | | | | | | | 1. CameraHal needs to call camera adapter setParameters when parameters that the camera adapter will update in getParameters are changed so that the camera adapter is properly updated before for a subsequent getParameters call. 2. Pass mParameters directly to camera adapter in getParameters call so that it can be updated with parameters that the camera adapter modifies. Change-Id: I26e8b6c39ff8be4af6bedb4d3eb1b81b4f3c2c17 Signed-off-by: Tyler Luu <tluu@ti.com>
* Update frame ref countingAkwasi Boateng2011-09-143-0/+6
| | | | | | | | | | | | | | | | | 1. Make only one sendframe call from OMXCameraAdapter 2. Add frame type mask to frame structure 3. Frame type mask used to indicate type of frame e.g video, preview, image or preview and video 4. Set frame ref count before sending frames to subscribers. 5. Hold frame subscriber lock for setting the refcount and sending the frames to the subscribers to allow for the number of subscribers not to change until frames are sent. Change-Id: Ic00a195847f2dc962e931ee8a9f36e3933e67c2d Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com>
* CameraHal: Modify exit behavior of notify threadTyler Luu2011-09-141-3/+2
| | | | | | | | | | | | | | | | | | When the camera app dies, sometimes the release() call is coming from the same thread as a callback instead of the main thread. When this happens, it causes a segfault in AppCallbackNotifier because we end up destroying AppCallbackNotifier without the NotificationThread knowing. The subsequent waitForMsg() after release() will result in a segfault since the message queues are deleted. Instead of looping forever in a while loop in the notification thread, return bool value in looper function. This gives the Thread class a chance to exit in case of a requestExit() in the same thread. Looper function will automatically will be called again if exit is not pending and previous looper function call returned true. Change-Id: I6bdc65df71e2c3ebcbd409654b828edef29b1a0e Signed-off-by: Tyler Luu <tluu@ti.com>
* Camera HAL: Crash media server in case of camera hardware errorsSundar Raman2011-09-141-0/+7
| | | | | | | | | | | | | | Applications do not handle errors other then CAMERA_SERVER_DIED. So there is no way for the application to know about fatal errors other than killing the media server when they happen. So this patch aborts media server whenever the ducati throws a fatal exception or when it hangs so that the apps notify the user of the error and then close. The user will be able to restart the application since the media server restarts automatically and the ducati is also restored by syslink automatically. Change-Id: Ic3e93130818edbe281affca99b808e09e08614c5 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHAL: Updates related to multiple MTS,CTS testsSundar Raman2011-09-121-1/+3
| | | | | | | | | | | | | | | | - Test '#testTakePicture' in both the MTS suite and the CTS package, require raw callbacks to be generated when 'takePicture()' is provided with an appropriate handler for it. Unfortunately, raw data is not always provided by the CameraAdapters. This modification adds the necessary functionality in order to enable raw callbacks, when needed. Change-Id: I1369f7a6edbc54195c5a71b35e0096c72d6ed368 Signed-off-by: Emilian Peev <epeev@mm-sol.com> Change-Id: I2b963f5c23d31b02f3d59e1ee8c36cf3cd195bb6 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHal: Add Exif support to video snapshotTyler Luu2011-09-123-1/+50
| | | | | | | | Use jhead library to insert Exif to jpeg stream returned from libjpeg. Change-Id: Ia6398180b7ef3c1b3ddcb35e489527289565fef5 Signed-off-by: Tyler Luu <tluu@ti.com>
* Unblock semaphores during Fatal ErrorsAkwasi Boateng2011-09-121-1/+0
| | | | | | | | | | | | | 1. Remove all pending events and unblock all waiting semaphore during Fatal error. 2. Exit execution when in invalid state. 3. Remove error nitiifcation from Appcallback thread Change-Id: I1612ff75e83ebf285d4cc168a829e0f81d4968b1 Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com>
* CameraHAL CTS: Fix for #testAutoExposureLock, #testAutoWhiteBalanceLockSundar Raman2011-09-121-1/+4
| | | | | | | | Locks were not retained if the user forces the lock to true before calling autoFocus. This patch addresses this scenario. Change-Id: I2b5161806f8123b3042d46bc856773f0d4701458 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHAL: Default continuous autofocus mode for 3rd party appsSundar Raman2011-09-121-0/+1
| | | | | | | | | | 3rd party apps like bar code scanner work really well with continous auto focus as the default mode. So this patch sets the default focus mode to continuous-picture Change-Id: I721ad98f26ad18a6ecf98c09c16ac17e8aacdf05 Signed-off-by: Sundar Raman <sunds@ti.com>
* Destroy and recreate semaphore in case of timeoutAkwasi Boateng2011-09-091-0/+5
| | | | | | | | Destroy and recreate semaphor during timeout and remove event from event queue. Change-Id: Id9428ff58a55f90a6807776327bfba1961d9089d Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com>
* FPS range and frame rate changesAkwasi Boateng2011-09-091-0/+2
| | | | | | | | | | | Adjust framerate to match fps range if app wants to a different fps range other than the defualt and also adjust fps range to match frame rate if app wants to chnage frame rate only. Change-Id: I1e15e4a021140f5b1cf78fcbb57c722a8e97e983 Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com>
* Set default fps range for video mode to 24<->30Akwasi Boateng2011-09-091-0/+1
| | | | | | | | Hack to allow image mode fps=15 and vide mode fps = 24 Change-Id: Ie2a4b3d5c7e32515a1af948fa65c934baaf3e1a9 Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com>
* CameraHal: Use the same gralloc usage bits for alloc and writeTyler Luu2011-09-071-0/+6
| | | | | Change-Id: I013fd9ff40efb0ceaa1575a5af1c077d72e7921d Signed-off-by: Tyler Luu <tluu@ti.com>
* Revert "Revert "CameraHAL : Multiple focus and exposure areas support""Iliyan Malchev2011-09-074-6/+14
| | | | This reverts commit 72bac2af47f73167bd288bc7278e5496ccabe6f4.
* Revert "CameraHAL : Multiple focus and exposure areas support"Iliyan Malchev2011-09-064-14/+6
| | | | | | | | | | This reverts commit bd9754a1b2c8d5e0a8788d0e42d018857bfef7a7. Conflicts: camera/inc/OMXCameraAdapter/OMXCameraAdapter.h Change-Id: Iad51c457b05de9b5492061b8402e508a6c5b42bf
* CameraHal: Set KEY_VIDEO_SNAPSHOT_SUPPORTED defaultTyler Luu2011-09-022-0/+4
| | | | | Change-Id: I106a62bc752398f52224d1b1b7ef78a703ab1f17 Signed-off-by: Iliyan Malchev <malchev@google.com>
* CameraHal: Initial support for video snapshotTyler Luu2011-09-022-2/+108
| | | | | | | | | | Adds support for capturing an image while recording in video mode. Sets up Ducati to return a YUV422I buffer and encode is performed in AppCallbackNotifier with Encoder_libjpeg class. Change-Id: Ia351fc99dab63a12add8c6c960b186bbe5be275a Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHAL : Multiple focus and exposure areas supportMilen Mitkov2011-09-024-7/+14
| | | | | | | | | | | | | | | | | | Adds support for multiple focus and exposure areas and also correctly returning the number of maximum supported focus and exposure areas. - Patch set 4: converting the coordinates, which are sent to 3A in the range 0 - 255. Both Focus and Exposure algorithms use this range - Patch set 5: Handling special area (0, 0, 0, 0, 0), rebasing and also memory allocation alignment to 4K chunks. - Patch set 6: Freeing the alloc'd buffer in case of error. Change-Id: I45bdd4309b75ac4d50deb05e97120362cdb1937b Signed-off-by: Milen Mitkov <mmitkov@mm-sol.com>
* CameraHAL: Fixes some uninitialized variables in OMXCameraAdapterTyler Luu2011-08-311-0/+2
| | | | | | | Change-Id: I3603c8ea55cf8ffc1479ec2cc0df437bd2838ad1 Original-author: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHAL: Adds locking when accessing 'mFocusAreas'Tyler Luu2011-08-311-0/+1
| | | | | | | | | | | | | | | | - This is due to the access pattern of 'mFocusAreas. Currently both 'setFocusMode()' and 'setParametersFocus()' can in parallel try to write/read from this Vector. A race condition is possible, in which the former method can clear a focus area, while the latter method is trying to increment its strong pointer. This will inevitably result in a segfault. Change-Id: I0e94d18326b85c20f73296d31d980b9c39685c32 Original-author: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHal: Fixes related to CTS #testPreviewPictureSizesCombinationTyler Luu2011-08-311-0/+1
| | | | | | | | | | | | | | - This test depends on the following camera functionality. After image capture is done, the camera client should be able to switch the preview resolution without first calling 'stopPreview()'. The patch adds the neccessary logic for recognizing this particular case and accordingly restarts the preview internally. Change-Id: I3648ba9259d3a4720a12c7a1242d62b670e5dfdc Original-author: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHAL: Improves GPS conversion accuracyTyler Luu2011-08-311-3/+6
| | | | | | | | | - Fix needed for CTS test #testJpegExif Change-Id: Ib43edeb569d014e94114e3d2a2017357ff9c0eb9 Original-author: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHAL: Enable GBCE by defaultSundar Raman2011-08-312-0/+2
| | | | | | | Needed to improve image quality Change-Id: I727b8ee21a186e1616e690f85075e4e8a64617f9 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHAL: Adds ION support to MemoryManagerSundar Raman2011-08-301-2/+8
| | | | | | | | | | | | | MemoryManager has been updated to allocate from ION carveout instead of 1D TILER via MemMgr. Note: 2D TILER allocation is not supported as it is not needed currently. We may have to add support for it in the future. Change-Id: I3507da9a26ef4cadfda26ee21c8e12bbce515656 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHAL: Reduce the number of zoom stages to make it responsiveSundar Raman2011-08-291-1/+1
| | | | | | | | Reduce the number of zoom stages from 61 to 31 to make the smooth zoom more responsive. Change-Id: I74eb20795cc5164cb03ca7155300bed7cd0716e6 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHal: Use LUT to populate VFR listTyler Luu2011-08-261-1/+6
| | | | | | | | | | Instead of trying to calculate supported VFR list from the min and max reported from Ducati, use a prepopulated LUT. It is difficult to programmatically add odd variable framerates, i.e (24,30). Change-Id: I149ee68dddd57f0f0f69ded6ad51739eec79c771 Signed-off-by: Tyler Luu <tluu@ti.com>
* Camera HAL: Do not call cancelBuffer when destroying the display adapterSundar Raman2011-08-262-2/+2
| | | | | | | | | | | | When a NULL window is passed in setPreviewDisplay, we try to do cancelBuffer to return the buffers to the ANativeWindow if there is a valid reference to DisplayAdapter. However, the CameraService already sets the ANativeWindow reference to NULL before calling setPreviewWindow method of the Camera HAL so the cancel_buffer crashes. So, we do not call cancel_buffer as the preview window is destroyed anyway by Camera Service. Change-Id: Ie07f5fd3ca5bb5a31cb25a174ee1acc2988628af Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHAL: Adds support for 'autoFocus()' calls during CAFSundar Raman2011-08-261-0/+2
| | | | | | | | | | | | | | - Previously during CAF any calls for doing AF were immediately returning status. The patch will check if CAF has succeeded in locking and if this is not the case it will temporarily switch to 'auto' triggering a full AF sweep. CAF is again restored afterwards. - Additionally this patch adds support for canceling AF during 'PREVIEW_STATE' state, which is needed in order to release the 3A lock after AF Change-Id: Ie8c9b77fb134e63ed668a22453c1672b34488d94 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHAL: OMX algo priority re-designSundar Raman2011-08-251-0/+3
| | | | | | | | | | | | | - Allows stacking of different algorithm priorities. - Resolves an issue with AF not functioning after one iteration. - Contains a couple of fixes related to WB and Exposure priority modes. Signed-off-by: Emilian Peev <epeev@mm-sol.com> Change-Id: I9c2848e776c727cd9cc3691221621f895dc5507b Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHAL: Fix a memory leak in Face detectionSundar Raman2011-08-241-0/+7
| | | | | | | | | In some cases mFaceData is NOT null and mFaceData->faces is NULL. In such cases we end up not freeing mFaceData. This patch takes care of this case and frees mFaceData in such cases. Change-Id: Ia73161064bec6f30f947f3ab596e09354e9d4b6d Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHAL: Add support for FOCUS_MODE_CONTINUOUS_PICTURESundar Raman2011-08-231-0/+1
| | | | | | | | | | | | | This patch adds HAL support for FOCUS_MODE_CONTINUOUS_PICTURE which is needed for enabling CAF in still image preview. Although the HAL behavior is same for both VIDEO and STILL CAF, by setting EFocusControlAuto for ducati, the ducati distinguishes STILL and VIDEO CAF internally based on Operating mode (pipeline that is selected - video or zsl) Change-Id: I808d41620caacca94dd65985c467f41417dee6d8 Signed-off-by: Sundar Raman <sunds@ti.com>
* omap4xxx: camera: lock gralloc buffers read-rarely/write-neverIliyan Malchev2011-08-231-1/+1
| | | | | Change-Id: Iacf80f7485e78d20000df27bca9e57caafcea111 Signed-off-by: Iliyan Malchev <malchev@google.com>
* CameraHal: Adjust FD callbacks to updated javadocTyler Luu2011-08-231-0/+2
| | | | | | | | FD callback behavior is updated in latest javadoc patch "Improve camera face detection javadoc." Change-Id: I963628ae55eec62083c25d34bbb380ae6673e431 Signed-off-by: Tyler Luu <tluu@ti.com>
* Revert "(TEMP) Avoid SetConfig when starting front sensor"Iliyan Malchev2011-08-171-24/+1
| | | | This reverts commit 2f394067996c47b8c02a335af7403c34908bff07.
* CameraHal: Fixes related to CTS test #testFocusAreasTyler Luu2011-08-162-0/+9
| | | | | | | | | | | | - Sanity checks should be performed on the individual areas for the test to pass. - On invalid configuration CameraParameters should revert to the last known good configuration. Change-Id: I9026f287e884835a98c835e8f949ad4441c030bd Original-author: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHal: Fixes related to CTS test #testPreviewFpsRangeTyler Luu2011-08-161-2/+0
| | | | | | | | | | | | - Framerate ranges were not ordered as per CTS requirement: ( maxFps1 < maxFps2 ) || (maxFps1 == maxFps2 && minFps1 < minFps2) - This modification also gives higher priority to framerate ranges over the deprecated constant fps. Change-Id: Idee8b7ae9c1a3ce1d947bc5067c2c787f30e4d39 Original-author: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Tyler Luu <tluu@ti.com>
* Camera Hal : Handle Recording Hint set by Camcorder ApplicationKalpesh Patil2011-08-151-1/+11
| | | | | | | | | | | | | | | Recoding Hint is set now by Camcorder App, in order to allow CameraHal to start preview is Recording specific mode (i.e. Video-Mode). This patch adds support to handle Recoding Hint in order to set/reset Recording specific parameters. This patch also takes care of following contraints set by Recording Hint support in framework. 1) Camera App can set/reset Recording Hint while preview is active. 2) Camera App can start recording even when the Recording Hint is false. Change-Id: I6332c316ddc3ddda7f8c9c5739f81e6317c7deb0 Signed-Off-By: Kalpesh Patil <kalpeshpatil@ti.com>
* OMAP4 Camera HAL: CTS: Setting defaults for some parametersSundar Raman2011-08-111-0/+3
| | | | | | | | | focal length, horizontal and vertical angles Addresses failures of following tests: Change-Id: I36107b8c5cffe843ce7d167a607b9f9269f3ed26 Signed-off-by: Sundar Raman <sunds@ti.com>
* Lock AE and AWB after AFSundar Raman2011-08-091-1/+1
| | | | | Change-Id: I12f1037be3d890b50c5413925d3084a2cf5256aa Signed-off-by: Sundar Raman <sunds@ti.com>
* (TEMP) Avoid SetConfig when starting front sensorTyler Luu2011-08-091-1/+24
| | | | | | | | | | | Delay SetConfig calls for the first 99 frames when starting front sensor. Front sensor is currently freezing if any SetConfig is called within those first frames. This patch needs to be removed once Ducati side issue is fixed. Change-Id: Ie50dab38724077443719a1061c9b038f59c6b545