summaryrefslogtreecommitdiffstats
path: root/camera/CameraHal.cpp
Commit message (Collapse)AuthorAgeFilesLines
* omap4xxx: camera: various fixesSundar Raman2011-10-071-20/+9
| | | | | | | | | | | | | | | | | | | clean up resources properly on exit: - Frees all resources in case of error during preview buffer allocation in ANativeDisplayAdadapter. - Fixes a couple of typos in BaseCameraAdapter. - Removes a possible memory leak during temporal bracketing. 'stopBracketing()' will never get properly executed when 'startImageCapture()' disables 'mBracketingEnabled'. - Stops temporal bracketing properly inside 'signalEndImageCapture()'. Change-Id: Ic122058c835e30f12f335a288164475b8f6d1c6d Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Sundar Raman <sunds@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* omap4xxx: camera: timing issue with autoFocus/cancelAutoFocusTyler Luu2011-10-071-2/+19
| | | | | | | | | | | | | | | | | | | | | | Fixes b/5332895 If cancelAutoFocus comes when Ducati is already sending focus callback, CameraHal will go ahead and send focus callback to the application. This can cause the subsequent autoFocus call to be acked almost immediately with the previous autoFocus call's notification. Application will think autoFocus is done while CamearHal is still focusing, takePicture from the application will return an error. To fix this issue, do not always send focus notification. We are going to internally enable/disable auto focus message. Enable focus message when autoFocus call comes and disable focus message after notification or if cancelAutoFocus call comes. This will prevent us from sending notify message if application calls cancelAutoFocus. Change-Id: I8c8892f14894e23a9d73fa1c2b058389d196eefa 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-32/+30
| | | | | | | | | | 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: EXIF thumbnail for video snapshotTyler Luu2011-10-071-0/+13
| | | | | | | | | | | | | | | | | 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-071-6/+168
| | | | | | | | | | | | | | | | | | 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-071-3/+3
| | | | | | | | | | | | | | | | | 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: Do not unset exposure/wb lock in stopPreviewTyler Luu2011-09-231-11/+0
| | | | | | | | Did not remove code that explicitly unsets white balance and exposure lock in stopPreview after capture case. Change-Id: I1f990eb0819223c3642205584d2124bccc47355c Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHa: Reset mDynamicPreviewSwitch after startPreviewTyler Luu2011-09-211-0/+1
| | | | | | | | | | mDynamicPreviewSwitch was not being reset after the first startPreview() call. This is causing the preview to be unecessarily restarted for the first capture and causing some hit in performance time. Change-Id: I47e8840414c6da523c40ad04eaad05e841907acb Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHAL CTS: Update the fps range passed by the appSundar Raman2011-09-211-0/+1
| | | | | | | | mParameters was not updated based on the setParameter from the app. Change-Id: I24a4cdec9355ea677c7e09f9060989d2c6f40ac3 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHAL: Fixes an issue with constant frame rate selectionSundar Raman2011-09-201-2/+4
| | | | | Change-Id: I2ca38e60f7a47d149aa5696ff8d8ca3246d2d479 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHal: Do not restart preview if already recordingTyler Luu2011-09-201-0/+5
| | | | | | | | | | | | Slight fix to the KEY_RECORDING_HINT logic. If we are already recording then we can just ignore the recording hint logic. Also, if recording has already started then we would already be in video mode anyways. b/5332829 Change-Id: I372f43dd961f137c204ce60f20de3bdd793f02ed Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHal: Stop video snapshot before trying to stop recordingTyler Luu2011-09-191-0/+9
| | | | | | | | If stopRecording comes before OMXCameraApdater can signal for endImageCapture...go ahead and end image capture from stopRecording Change-Id: I7c8142ba95475d823c9569cf9e72338d2da53f14 Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHAL: Fixes for FPS range configurationSundar Raman2011-09-191-73/+66
| | | | | Change-Id: Idfc506812d6e0f1d88bdc5d7d62c159f9c9ad642 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHal: Ensure frames are returned by AppCallbackNotifierTyler Luu2011-09-161-0/+1
| | | | | | | | | | | | | | | 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-7/+29
| | | | | | | | | | | 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>
* 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: 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>
* Unblock semaphores during Fatal ErrorsAkwasi Boateng2011-09-121-1/+1
| | | | | | | | | | | | | 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>
* FPS range and frame rate changesAkwasi Boateng2011-09-091-19/+78
| | | | | | | | | | | 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/+10
| | | | | | | | 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: 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>
* Revert "Revert "CameraHAL : Multiple focus and exposure areas support""Iliyan Malchev2011-09-071-0/+5
| | | | This reverts commit 72bac2af47f73167bd288bc7278e5496ccabe6f4.
* Revert "CameraHAL : Multiple focus and exposure areas support"Iliyan Malchev2011-09-061-5/+0
| | | | | | | | | | This reverts commit bd9754a1b2c8d5e0a8788d0e42d018857bfef7a7. Conflicts: camera/inc/OMXCameraAdapter/OMXCameraAdapter.h Change-Id: Iad51c457b05de9b5492061b8402e508a6c5b42bf
* CameraHal: Set KEY_VIDEO_SNAPSHOT_SUPPORTED defaultTyler Luu2011-09-021-0/+1
| | | | | Change-Id: I106a62bc752398f52224d1b1b7ef78a703ab1f17 Signed-off-by: Iliyan Malchev <malchev@google.com>
* CameraHal: Initial support for video snapshotTyler Luu2011-09-021-18/+32
| | | | | | | | | | 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-021-0/+5
| | | | | | | | | | | | | | | | | | 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 related to CTS #testPreviewPictureSizesCombinationTyler Luu2011-08-311-50/+71
| | | | | | | | | | | | | | - 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: Enable GBCE by defaultSundar Raman2011-08-311-0/+1
| | | | | | | 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-0/+2
| | | | | | | | | | | | | 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: 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>
* 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: Fixes related to CTS test #testFocusAreasSundar Raman2011-08-251-6/+6
| | | | | | | | | | | | - The recording hint implementation was bypassing the logic for restoring the original correct CameraParameters, which is needed for passing the test. Signed-off-by: Emilian Peev <epeev@mm-sol.com> Change-Id: I8c119153dfedab5511955bff1d4c1193014ed720 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHAL: Fixes a possible segfault during deinitializationSundar Raman2011-08-251-1/+1
| | | | | | | | | | | | | | | | - If the client releases the camera when the ANativeDisplayAdapter is paused, then a segfault is possible. This is due to the deferred deinitialization of ANativeDisplaAdapter in it's destructor. By this time 'mPreviewWindow' in 'CameraHardwareInterface' is already NULL and all further calls involving it will result in a segfault. - Contains a fix for several CTS tests including #testJpegThumbnailSize and #testJpegExif. Change-Id: I030e8fdccdacc6d3bf08550da562eac90b50adc3 Signed-off-by: Sundar Raman <sunds@ti.com>
* CameraHAL: Add support for FOCUS_MODE_CONTINUOUS_PICTURESundar Raman2011-08-231-35/+36
| | | | | | | | | | | | | 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>
* CameraHal: Adjust FD callbacks to updated javadocTyler Luu2011-08-231-0/+6
| | | | | | | | 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>
* CameraHal: Fixes related to CTS test #testFocusAreasTyler Luu2011-08-161-0/+6
| | | | | | | | | | | | - 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-36/+23
| | | | | | | | | | | | - 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>
* CameraHal: Returns error for invalid parameters.Tyler Luu2011-08-161-141/+165
| | | | | | | | | | | Returns error for the invalid parameters in setparameters(). Fixes a cts test failure(#testInvalidParameters). Change-Id: I11ae111404b64641ccc0ac89f5abe854acb18c35 Original-author: Solaiyappan Saravanan <saravanan.s@ti.com> Signed-off-by: Solaiyappan Saravanan <saravanan.s@ti.com> Signed-off-by: Tyler Luu <tluu@ti.com>
* Camera Hal : Handle Recording Hint set by Camcorder ApplicationKalpesh Patil2011-08-151-498/+643
| | | | | | | | | | | | | | | 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>
* Camera Hal : Enable VSTAB & VNF for Front CameraKalpesh Patil2011-08-121-36/+31
| | | | | | | | | | This patch enables of VSTAB & VNF for Front Camera. The issue with VSTAB & VNF for Front Camera for 720p resolution has been resolved on Ducati side. So patch-I28a81696 is being reverted by this patch. Change-Id: Ie723b2e2a59d0dec7aefd5c9362e24b0dd2f5562 Signed-Off-By: Kalpesh Patil <kalpeshpatil@ti.com>
* initial commitIliyan Malchev2011-08-081-0/+3030
Change-Id: I8f7a7eeece0e516efa486b77e9d97805c0e65d3e Signed-off-by: Iliyan Malchev <malchev@google.com>