summaryrefslogtreecommitdiffstats
path: root/camera
Commit message (Collapse)AuthorAgeFilesLines
...
* CameraHal: set ZSL history lenVladislav Hristov2011-09-141-0/+22
| | | | | | | | | | | | | | | | | | | | | | | As both ZSL and VideoSnapshot uses ZSL queue for imaga capture, there is a common ducati parameter to configure the number of buffers in the queue. This patch dynamicaly sets the number of buffers in the queue, depending on the usecase. Sets the default ZSL history len to six in case of the ZSL mode and uses four for everything else (currently only VideoSnapshot). Having six buffers for ZSL mode, more RAW buffers are available in the ducati side. This way using ZSL capture with six buffers it is possible to compensate da preview lag. On the other side, if using six buffers for video case, there is not enough memory, in the ducati, for both RAW buffers pool and encoder internal memory. The Shutter lag in the VideoSnapshot is not that visible, the time error because of the two buffers less (max of 66ms) will not be noticed in captured image. Change-Id: I03bd23240158150a116f5ef15ad43c7d28ac0534 Signed-off-by: Vladislav Hristov <vhristov@mm-sol.com>
* CameraHal: Set AF Assist depending on flash modeVladislav Hristov2011-09-141-0/+28
| | | | | | | | | Enable setting AF Assist enable/disable based on the flash mode. When Flash is "on" or "auto" enable AF Assist. When Flash is "off" disable AF Assist. Change-Id: I963694c5e46ccbe0e1dea5acfd5eca4ea89c163e Signed-off-by: Vladislav Hristov <vhristov@mm-sol.com>
* CameraHal: Optimize uyvy to yuv44 conversionTyler Luu2011-09-141-15/+52
| | | | | | | | | Slightly optmizing the color format conversion from uyvy to yuv44. Now converting 16 pixels at one time instead 2. Change-Id: I88c216c95603f84a39bd30ed1964a977e2af85ec Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHal: Fixes for setParameter in CameraHalTyler Luu2011-09-142-7/+30
| | | | | | | | | | | 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-146-111/+257
| | | | | | | | | | | | | | | | | 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-142-36/+30
| | | | | | | | | | | | | | | | | | 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>
* CameraHAL:CTS: Lock AE,AWB irrespective of focus lock statusSundar Raman2011-09-141-9/+9
| | | | | | | | This is needed to pass testAutoWhiteBalanceLock and testAutoExposureLock CTS tests Change-Id: I96a88a72d6b5b3503ff9d215ba56746576892cdf Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHAL: MTS: Synchronize AppCallbackNotifier::stop with notifyFrameSundar Raman2011-09-141-22/+62
| | | | | | | | | | | | | AppCallbackNotifier::stop has to wait for any 2D copies to complete before exiting because the tiler 2d memory might get released by the destruction of the surface after stopPreview finishes. This patch takes care of synchronizing any ongoing copies from surface buffers with the stop method and effectively avoids access after free issues. Change-Id: Id7e5b6fab4a2a6b7fcce0ba8b9bd3ad315263eaa Signed-off-by: Sundar Raman <sunds@ti.com>
* Camera HAL: Crash media server in case of camera hardware errorsSundar Raman2011-09-143-8/+24
| | | | | | | | | | | | | | 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>
* Camera HAL: HomeScreen fix: Check for image cap before exiting stopPreviewSundar Raman2011-09-141-1/+3
| | | | | | | | | stopPreview was returning if just the mDisplayPaused was set. It should go ahead and stop image capture if it is in progress. Also, the setParameter for restoring focus locks will be done as part of stopping the image capture. Change-Id: I1c064ca3c0906faffb507bf2e656259334272304 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHAL: HomeScreen Fix: Make releaseImageBuffers a no-opSundar Raman2011-09-141-5/+10
| | | | | | | | 1. Make releaseImageBuffers a no-op for now because it is racing against AppCallbackNotifier 2. Move freeImageBufs during exit to be called after the AppCallbackNotifier exit. Change-Id: Ia127f5799dadb58f75dd6b2ebe8d58aed2303d60 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHAL: Updates related to multiple MTS,CTS testsSundar Raman2011-09-122-19/+80
| | | | | | | | | | | | | | | | - 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: Checks preview buffer registration statusSundar Raman2011-09-121-2/+9
| | | | | | | | | | | | - This modifcation should bypass some of the software overheads involved in notifiying the client for any errors occuring during the preview buffer registration. Change-Id: I403d4ce065cb6cc794ce98f7d010d3f3caeb43e4 Signed-off-by: Emilian Peev <epeev@mm-sol.com> Change-Id: I4e017dfbb0a0101ded1c8c0b13d7f8fc5993ea05 Signed-off-by: Sundar Raman <sunds@ti.com>
* OMAP4: Camera: Video: Update timestamp offset only when recording beginsDevaraj Rangasamy2011-09-121-1/+3
| | | | | | | | | | | | Update timestamp offset only when recording begins, or else camera buffers wont have timestamp field updated, hence resulting in wrong calculation. Patcset2: Update bitwise AND to logical AND in logic conditon Change-Id: Ia3f9051b7c1b2035d00c0e1d1137e1259feb1443 Signed-off-by: Devaraj Rangasamy <dev@ti.com>
* CameraHal: Add Exif support to video snapshotTyler Luu2011-09-129-12/+351
| | | | | | | | 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-126-32/+150
| | | | | | | | | | | | | 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: Handle a few corner cases with captureTyler Luu2011-09-122-3/+19
| | | | | | | | | | | 1. Do not apply 3A settings in the middle of a capture. Causing an issue with the capture pipe 2. If we happen to unregister shutter callback while somebody is still waiting for it, go ahead and signal them. Change-Id: I961571a1feeec5349b9888748cf002e1e30cea4e Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHAL CTS: Fix for #testAutoExposureLock, #testAutoWhiteBalanceLockSundar Raman2011-09-125-14/+26
| | | | | | | | 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-123-1/+14
| | | | | | | | | | 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>
* omap4xxx: hasta la vista, libtimemmgrIliyan Malchev2011-09-093-8/+0
| | | | | Change-Id: Ib2e253090258299ec21f9f17e1763be8bf3cc1dc Signed-off-by: Iliyan Malchev <malchev@google.com>
* Destroy and recreate semaphore in case of timeoutAkwasi Boateng2011-09-094-19/+70
| | | | | | | | 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-092-19/+80
| | | | | | | | | | | 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-095-7/+16
| | | | | | | | 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-073-14/+10
| | | | | Change-Id: I013fd9ff40efb0ceaa1575a5af1c077d72e7921d Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHal: Handle stopPreview properly for preview in progressTyler Luu2011-09-071-21/+30
| | | | | | | | | | | | | During some cases like when phone orientation changes after startPreview call but before setPreviewDisplay, stopPreview is called by application. Before we were seeing some error messages from camera adapter state machine because we were trying to make some improper state transitions. This patch guards against that. This patch also resets the mPreviewStateInProgress flag in stopPreview Change-Id: If5e4c235b0937b37f567d9b1ed9bd4478ace69d4 Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHAL: Re-enable CAF status query from DucatiSundar Raman2011-09-071-8/+1
| | | | | | | This requires ducati fixes for CAF to be present. Change-Id: I6a43c30be2d293f42d4761989b3b70aa1444f7f5 Signed-off-by: Sundar Raman <sunds@ti.com>
* Revert "Revert "CameraHAL : Multiple focus and exposure areas support""Iliyan Malchev2011-09-079-47/+265
| | | | This reverts commit 72bac2af47f73167bd288bc7278e5496ccabe6f4.
* Revert "CameraHAL : Multiple focus and exposure areas support"Iliyan Malchev2011-09-069-265/+47
| | | | | | | | | | This reverts commit bd9754a1b2c8d5e0a8788d0e42d018857bfef7a7. Conflicts: camera/inc/OMXCameraAdapter/OMXCameraAdapter.h Change-Id: Iad51c457b05de9b5492061b8402e508a6c5b42bf
* Don't set AF modes when AF is activeAkwasi Boateng2011-09-021-1/+4
| | | | | | | Prevents multiply calls to focus Setconfig() Change-Id: I3b3df7ffbef11690d3cde4cdaa6fa59e59146388 Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com>
* CameraHAL: Removes deprecated AF codeAkwasi Boateng2011-09-021-7/+0
| | | | | | | | | | | | | - Previously if CAF was running and the camera client changed the focus mode to something else, then OMXCameraAdapter would immediately stop CAF as well. This behavior is not required any more and leads to some incorrect AF configuration calls. Change-Id: I72b0b8f64eeeb0d6e41994329ade9f462a0743ac Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com>
* CameraHal: Set KEY_VIDEO_SNAPSHOT_SUPPORTED defaultTyler Luu2011-09-026-0/+8
| | | | | Change-Id: I106a62bc752398f52224d1b1b7ef78a703ab1f17 Signed-off-by: Iliyan Malchev <malchev@google.com>
* CameraHal: Initial support for video snapshotTyler Luu2011-09-029-41/+523
| | | | | | | | | | 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-029-48/+265
| | | | | | | | | | | | | | | | | | 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: fix FD coordinate calculationTyler Luu2011-08-311-1/+4
| | | | | | | | | | | | | | The android expects coordinates for 180degree rotation to point the top left corner of the preview. When rotation is applied the ducati is returning the faces with respect to the camera orientation, rathar than the phone orientation. In this case both the nTop and nLeft needs to be offset with the size of the face, as the rotation counts for both of them. Change-Id: I28cd8e4c0c09e6d115f24f227c8044e514a42fef Original-author: Vladislav Hristov <vhristov@mm-sol.com> Signed-off-by: Vladislav Hristov <vhristov@mm-sol.com> Signed-off-by: Tyler Luu <tluu@ti.com>
* Possible memory leak fixTyler Luu2011-08-311-0/+16
| | | | | | | | | | EventMsgQ may still have unreleased messaages during OMX adapter deinit Change-Id: Iab91e68d7f5027b5b890ecf9270f2c9c333a3373 Original-author: Akwasi Boateng <akwasi.boateng@ti.com> Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHAL: Fixes some uninitialized variables in OMXCameraAdapterTyler Luu2011-08-313-0/+69
| | | | | | | 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: Fixes memory leaks inside ANativeWindowDisplayAdapterTyler Luu2011-08-312-13/+11
| | | | | | | | | | | | | - Every call to 'allocateBuffer()' is allocating a 'buffers' array on the heap, which is never used and never released. - Every call to 'setFrameProvider()' is instantiating a new FrameProvider instance, which is never released. Change-Id: I73ee9d35d9cb32709078334d199932fe78c2b7bb 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 for CTS test #testJpegCallbackStartPreviewTyler Luu2011-08-311-3/+9
| | | | | | | | | | | | | - The camera client should be able to restart the preview from within the context of a jpeg callback. Depending on the binder ipc timing this may not be possible, because image capture is stopped right after the jpeg data callback. Change-Id: Id006ecd4d9f82eaa74b38f921bed2543f8c0c217 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-313-3/+8
| | | | | | | | | | | | | | | | - 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-312-50/+72
| | | | | | | | | | | | | | - 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-312-23/+35
| | | | | | | | | - 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-316-0/+6
| | | | | | | Needed to improve image quality Change-Id: I727b8ee21a186e1616e690f85075e4e8a64617f9 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHal: Fix calculation of left coord in flipTyler Luu2011-08-301-15/+20
| | | | | | | | | This calculation was previously being handled in Ducati. However, with face tracking integration, this calculation needs to be moved to CameraHal. Change-Id: Icf416b077214edfe43597adff1af9eadefa20a89 Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHAL: Adds ION support to MemoryManagerSundar Raman2011-08-306-98/+83
| | | | | | | | | | | | | 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: Lock buffers sent to FrameProviderTyler Luu2011-08-302-6/+61
| | | | | | | | | | Use GraphicBufferMapper API to lock buffer before sending to FrameProvider to ensure there isn't simultaneous accesses to bufffer by SGX Change-Id: Ifbb5c88bac49b1b494bd984137b523d35f4a6f57 Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHal: Release 3A locks for stop during pausedTyler Luu2011-08-301-0/+12
| | | | | | | | Release 3A locks when calling stopPreview after a capture when the display is still paused. Change-Id: I65a415209fcd47bc612f3b263444f865b02c2c8f Signed-off-by: Tyler Luu <tluu@ti.com>
* Remove some non fatal error logs in Camera use-caseSundar Raman2011-08-301-1/+1
| | | | | Change-Id: I3d0f40b68c2337e67271784c544db8979dcc0358 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHAL: Remove black bars avoidance codeSundar Raman2011-08-301-40/+1
| | | | | | | | | | Now that there is support for recording hint and also since there is no black filling in ducati, remove the code that was doing aspect ratio corrections when the mode was NULL Change-Id: Iecda0702493ed5eb481c2c17bf41c1305294b899 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHAL: Reduce the number of zoom stages to make it responsiveSundar Raman2011-08-293-46/+16
| | | | | | | | 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-262-24/+52
| | | | | | | | | | 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>