summaryrefslogtreecommitdiffstats
path: root/camera/BaseCameraAdapter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* camera: don't hang while taking pictures in VIDEO_AF_STATEMichael Gernoth2015-02-031-0/+6
| | | | Change-Id: I6ef62da68b82ece315cfb5c6101d8e8c5776b29c
* camera: handle CAMERA_QUERY_BUFFER_SIZE_IMAGE_CAPTURE in VIDEO_AF_STATEMichael Gernoth2015-02-031-0/+7
| | | | Change-Id: Ib6b7cd411858674f4b9b96076ac71c551687b918
* camera: handle switch from AF_RUN to CAMERA_START_VIDEOMichael Gernoth2015-02-031-0/+6
| | | | Change-Id: I642aab8e69c90121d565ea76071ec73555102377
* camera: Handle capture request in AF runAlex Ray2015-02-031-0/+6
| | | | | | | camera: Handle capture request in AF run Bug: 8140969 Change-Id: I1e1889434d57714cdb0c10929609eade299c1ea9
* CameraHAL: Correctly calculate frame ref counterAndriy Chepurnyy2015-02-031-47/+71
| | | | | | | | | | | | This patch fix reference calculation during AV record usecase. Previously there was some logic that counts reference depends what type of frame passed. That leads to race condition in case of video snapshot. Now all possible types of subscriptions will be counted for particular frame. Change-Id: If183fdc425a25424fdb3ca5d31a0030c3669f322 Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
* CameraHAL: Snapshot buffers reference counter fixAndriy Chepurnyy2015-02-031-2/+2
| | | | | | | | Use CameraBuffer* instead of uint for key in snapshot subscribers map. Change-Id: I1fc800840e120e535c3197b9856d6a1da48c4e7a Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
* Merge branch 'd-jb-mr0-release-camera' into p-jb-mr1-releaseDaniel Levin2012-12-041-13/+12
|\ | | | | | | | | | | | | | | | | | | Conflicts: camera/OMXCameraAdapter/OMXCameraAdapter.cpp test/CameraHal/camera_test_bufferqueue.h test/CameraHal/camera_test_surfacetexture.cpp Change-Id: I1f13c6a5b6369e943773d04a650406a79eb95750 Signed-off-by: Daniel Levin <dendy@ti.com>
| * CameraHal: Init capture reference count logic to derived adaptersTyler Luu2012-11-261-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | - Moving initializing for capture reference count to derived adapters since useBuffers call for capture is going to called queuing shots as well. - This patch needs to include V4L adapter before merging on mainline. Change-Id: Ifc4986a68173234ec636ef943b62009f7df1e041 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
| * CameraHal: Change state machine flow for queuing shotsTyler Luu2012-11-261-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | - Instead of having to have CameraHal deal with logic to queue shots, move the code flow to state machine and respective camera adapters, so they can interally handle it. Now call flow for queuing shots and regular capture should be the same from CameraHal perspective. Change-Id: I9a74008aeaabc8dd169c78f6a85201f50580d25c Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
| * CameraHal: Image size query in initialized stateTyler Luu2012-11-261-1/+0
| | | | | | | | | | | | | | | | | | - Do not allow image buffer size query while in initialized state. OMXCameraAdapter doesn't support this... Change-Id: Id66ce67f5cb3667ce883c0ebbd482e958146be08 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
* | Camera: Protect mBuffersWithDucatiDaniel Levin2012-11-221-0/+3
| | | | | | | | | | | | | | | | Using mBuffersWithDucati simultaneously from separate threads causes race condition in debug mode. Change-Id: Ie24546dce12ff6f516a74fcf4887c4e8073ff8e0 Signed-off-by: Daniel Levin <dendy@ti.com>
* | Merge branch 'p-jb-mr0-release-camera' into p-jb-mr1-releaseDaniel Levin2012-11-221-277/+647
|\ \ | |/ | | | | | | | | | | | | | | Conflicts: camera/Android.mk camera/MemoryManager.cpp Change-Id: Ibe1f6706293903b50cc7d48d7de8dd9448b981e4 Signed-off-by: Daniel Levin <dendy@ti.com>
| * CameraHAL: Fix for raw+jpeg capture after 1st time.Saravanan Solaiyappan2012-10-101-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [Comment] -This patch handles the CAMERA_USE_BUFFERS_VIDEO_CAPTURE command in the state machine. Though this command will not change the state, this will avoid returning error to the caller. -Re-uses the same video buffer for the raw capture after first time. This can be improved in the future to reconfigure video port every time capture is done and allocate the buffer every time capture is made. Change-Id: I94853fc62c847083320bb03ade57eb21847b91b2 Signed-off-by: Solaiyappan Saravanan <saravanan.s@ti.com> Signed-off-by: Daniel Levin <dendy@ti.com>
| * Camera: Use share buffer allocator for metadataEmilian Peev2012-10-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | For perfomance reasons stop parsing metadata as strings and use a common 'camera_metadata_t' structure instead. The storage behind it is backed by a shared allocator in order to propagate the data between different process address spaces efficiently. Change-Id: I960057d56440f07ffafe42d70d221c4a2b564f97 Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
| * Merge "camera: fix deadlock because of mStateSwitchLock" into jb-migrationDaniel Levin2012-07-251-0/+6
| |\ | | | | | | | | | | | | Change-Id: I30238b6ff0a7cbab7a4908b88e1ca1be3ac3a89c Signed-off-by: Daniel Levin <dendy@ti.com>
| * | CameraHAL: Moved Camera HAL sources out of namespace androidDaniel Levin2012-07-251-30/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C++ namespace android:: is reserved for base Google Android types to avoid current and further conflicts with 3rd party code. Having TI Camera HAL under namespace android:: violates this rule, adding potential conflicts. This patch moves libtiutils and Camera HAL code out of namespace android:: to custom local namespaces. Putting camera code under namespace android and 'using namespace android' is not allowed anymore. All C++ Android types should have android:: namespace prefix explicitly. Next namespaces added: - Ti:: - placeholder for all custom code - Ti::Utils:: - common utility helper library - Ti::Camera:: - Camera HAL code Also added Ti::status_t as typedef for android::status_t. Change-Id: Ie8cc00d6d6bd4e8a8ddf089421010c370ee40ebe Signed-off-by: Daniel Levin <dendy@ti.com>
| * | CameraHAL: Portability changesDaniel Levin2012-07-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Moved common definitions to Global.h header: - CAMHAL_LOG* macros (also added CAMHAL_LOGI and CAMHAL_LOGW) - CAMHAL_ASSERT* macros - CAMHAL_UNUSED macro 2. Renamed NV12_resize.c to NV12_resize.cpp 3. Added common math functions into UtilsGlobal.h header: - min(a, b) - returns min of a and b - max(a, b) - returns max of a and b - bound(min, a, max) - return nearest value to a in scope [min..max] - floor(a) - round a to lower integer - round(a) - round a to nearest integer 4. Portability: - Fixed LOG* macros to use appropriate CAMHAL_LOG* wrappers. - Reworked the Android.mk to include proper directories depending on current pastry. Change-Id: I6fbd1ee02d8af2195b91cc357ddcf554fe77f495 Signed-off-by: Daniel Levin <dendy@ti.com>
| * | CameraHAL: Use capture data from CameraAdapterVladimir Petrov2012-07-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Change getPictureBufferSize call to give back more data about the capture buffer that we need to allocate. 2. Use the data from getPictureBufferSize to allocate the buffer. Change-Id: I23bac42eedb9b6852eca24c207c474f3dbecced1 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
| * | Reconcile with p-ics-mr1-release branch.Daniel Levin2012-07-251-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | Only minor cosmetic changes and line ending fixes that was present in p-ics-mr1-release branch but absent in p-ics-mr1. Change-Id: I79f860007f202a3bdbb6d173b6a3f5ac53640417 Signed-off-by: Daniel Levin <dendy@ti.com>
| * | CameraHAL: Wrapped sources with OMAP_ENHANCEMENT_* macrosDaniel Levin2012-07-251-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wrapped the enhanced code with OMAP_ENHANCEMENT_* macros. Currently next enhancing modules dedicated: - CPCAM: OMAP_ENHANCEMENT_CPCAM - VTC: OMAP_ENHANCEMENT_VTC - S3D: OMAP_ENHANCEMENT_S3D - Burst capture: OMAP_ENHANCEMENT Disabled the VTC test. Disabled the camera_test. Must be used together with: http://review.omapzoom.org/#/c/23318/ Change-Id: Ie23aa6b7e0a72dabe529f2828442afa0464d4af4 Signed-off-by: Daniel Levin <dendy@ti.com>
| * | camera: add exp/gain preview metadataTyler Luu2012-07-251-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | add ability to send current preview exposure time and analog gain to application. Preview metadata implementation is extended to support photometry data along with face detection data. Depends on Change-Id Ia4fcfbeb: camera: Add Exp./Gain preview metadata Change-Id: I3a4c7548d0e98f3a8c29e305fd746f0241cb45e4 Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
| * | CameraHal: Handles preview and snapshot buffers separatelyEmilian Peev2012-07-251-4/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Hal should differentiate between preview and snapshot frames. The camera client can expect postview callbacks even if the preview frame notifications are internally disabled during image capture. Change-Id: I5ab7ecf51860989bf983e4dc116f6816ee57e8f7 Signed-off-by: Emilian Peev <epeev@mm-sol.com>
| * | CameraHal: Changes necessitated by slice based processingPrasanna Kumar M.R2012-07-251-5/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch reverts the revert commit http://review.omapzoom.org/#/c/22000/ and enables the Slice mode in camera hal as in original patch http://review.omapzoom.org/#/c/19749/ Couple of changes are present in addition to original patch: The initial revert was to due to 60fps issue on OMAP5. The issue was debugged and confirmed to be caused by combination of existing code for handling state change when sensor overclocking is enabled in combination with port enable/disable changes of this patch. Mutex handling has been updated to improve the scenario (another patch expected from camera team to manage port status) Another change has also been incorporated in this patch to address the logging related compilation issue when debug flags are enabled in camera hal. Change-Id: I5b78d2bdc3f82133be8447176bebde7f4673441b Signed-off-by: Prasanna Kumar M.R. <prasanna.kumarmr@ti.com> Signed-off-by: Anu Sundararajan <sanuradha@ti.com>
| * | CameraHAL: Prevent possible deadlock scenarioTyler Luu2012-07-251-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hold scope of returnFrame lock for just the calculation of refCount. Otherwise, we could have a scenario where endImageCapture and stopRecording could cause a deadlock competing for mReturnFrameLock and mLock. Issue arises mainly because endImageCapture is signalled from fillThisBuffer which stopRecording will need to get into. Change-Id: I3a125711632fa311fd794e300cd5008321a84c40 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Daniel Levin <dendy@ti.com>
| * | Merge branch 'cpcam/DEV_DB54' into cpcam/latestTyler Luu2012-07-251-37/+5
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: camera/inc/CameraHal.h Change-Id: I6f96dedfdbf3956fbbf796aa7b768ae13c9c61df
| | * | Revert "CameraHal: Changes necessitated by slice based processing"Saravanan Solaiyappan2012-07-251-37/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 3b51680449dc324b9a44370a9dddfd0a34e1281d. Change-Id: I07a063b0d114eecb0320600612dea4c631796f7f Signed-off-by: Solaiyappan Saravanan <saravanan.s@ti.com>
| * | | Merge branch 'cpcam/DEV_DB43' into cpcam/latestTyler Luu2012-07-251-5/+37
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: camera/ANativeWindowDisplayAdapter.cpp camera/inc/ANativeWindowDisplayAdapter.h camera/inc/CameraHal.h Change-Id: I772e1a1ea4cf716c815b878029532fe4b86cff88
| | * | CameraHal: Changes necessitated by slice based processingAnu Sundararajan2012-07-251-5/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Slice based processing requires a tunnel to be set up between camera and encoder. Because of tunneling, the OMX state transtion must happen in a particular order. Therefore, new commands have been added to allow the application to control the state transition. Existing cameraHal clients like CameraService need not do anything different. Initialization: --------------- Application creates an instance of the camera. At this point, camera is in loaded state. Application calls setParameter(sliceheight/encoder handle) to set up the tunnel and slice parameters. Application calls sendCommand(CAMERA_CMD_PREVIEW_INITIALIZATION, ...) to move the camera to idle state. Application calls startPreview() to move the camera to executing state. Deinitialization: ----------------- Application calls sendCommand(CAMERA_CMD_PREVIEW_DEINITIALIZATION, ...) to move the camera to idle state. Application calls stopPreview() to move the camera to loaded state. If the application does not call sendCommand(CAMERA_CMD_PREVIEW_INITIALIZATION, ...), then during startPreview, the camera moves from loaded to idle to executing like before. Similarly, if the application does not call sendCommand(CAMERA_CMD_PREVIEW_DEINITIALIZATION, ...)then during stopPreview, the camera moves from executing to idle to loaded like before. Disabling the preview port and freeing the buffers caused ducati to go into a bad state. This issue is observed only during slice mode. Therefore, preview port disable/enable has been removed and the preview buffers are now freed when moving from idle to loaded state. Change-Id: I7039c854f1358c22b6f5e116dcadfd025185bee1 Signed-off-by: Prasanna Kumar M.R. <prasanna.kumarmr@ti.com> Signed-off-by: Anu Sundararajan <sanuradha@ti.com>
| | * | CameraHAL: Handling more Invalid state operations after stop previewGeorgi Georgiev2012-07-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After stop and stop preview the adapter state is being changed. So, when it's changed to INITIALIZED_STATE, this causes invalid CameraComands for image capture: CAMERA_STOP_IMAGE_CAPTURE and CAMERA_STOP_BRACKET_CAPTURE. The patch fixes DR:OMAPS00259748. Change-Id: Ic12cdef8f1fcf1e0b1342954baa49fb9680f9a21
| * | | camera: fix some logging issuesTyler Luu2012-07-251-1/+11
| | | | | | | | | | | | | | | | | | | | Change-Id: I8d622030fe844aeeb00af8b4756e5038bd7d941c Signed-off-by: Tyler Luu <tluu@ti.com>
| * | | camera: fix stopping preview in cpcam modeTyler Luu2012-07-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few small fixes for stopping preview after capture or process in cpcam mode when not returning back to preview pipe. Change-Id: I6b98cf7f48294500e61ba262e5e59a97cfa77880 Signed-off-by: Tyler Luu <tluu@ti.com>
| * | | camera: add reprocess() functionalityTyler Luu2012-07-251-3/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implementation for reprocess state change sequence should look like this: preview->loaded_reprocess->loaded_reprocess_capture-> reprocess Reprocess uses takePicture call to send output buffers to camera adapter and to signal start reprocess. Change-Id: I98a7ccd32778760603e9c367ab3cd4ef30fab8dc Signed-off-by: Tyler Luu <tluu@ti.com>
| * | | CameraHal: Continuous bracket shot in cpcamTyler Luu2012-07-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initial implementation for continuous burst capture for cpcam usecase. This implementation is currently only appending shot requests to the end of the queue. TODO: 1. Add flush call to flush shot queue so we don't have restart preview to clear it. Change-Id: Ia2116f9d9410fdee76ad5e563947d63ea5c6774f Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com> Signed-off-by: Tyler Luu <tluu@ti.com>
| * | | CameraHal: Add function to get token to send to rpmsgTyler Luu2012-07-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding helper function to get token (handle, fd, etc.) to send to rpmsg based on buffer type Change-Id: Idcd7b7b290e94f64ab39ee855dc2820c3da5b560 Signed-off-by: David Schleef <ds@ti.com> Signed-off-by: Tyler Luu <tluu@ti.com>
| * | | CameraHal: Add CameraBuffer (major refactoring)Tyler Luu2012-07-251-28/+28
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a CameraBuffer type, which contains information corresponding to an internal CameraHal buffer - how it was allocated, relevant handles, and any internal data to be associated with the buffer, such as metadata, OMX indexes, current state. The simplest possible refactoring was done to convert the void * used for exchanging buffer information into the 'opaque' field in the CameraBuffer structure. A few hacks were added to minimize the size of the refactoring, these will be cleaned up in upcoming commits. Adding a private structure for buffers eliminates the need for a lot of KeyedVectors that are currently in use. Most of these were left in place, and will be refactored into the CameraBuffer structure later. The pAppPrivate field of OMX_BUFFERHEADERTYPE was used to eliminate another KeyedVector. Change-Id: I147ad971e4cdc03b2c445b5fba81d0ba83bc5fb3 Signed-off-by: David Schleef <ds@ti.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com> Signed-off-by: Tyler Luu <tluu@ti.com>
| * | CameraHAL: Adds LUT table for 'CameraCommands' at setState()Georgi Georgiev2012-07-251-98/+147
| | | | | | | | | | | | | | | | | | | | | The enum values of CameraCommands are printerd in LOGDB as strings instead of integers. Change-Id: Ide926d4497ba8a50ed5a6cb4671a8eac027b521e
| * | CameraHAL: V4LCameraAdapter co-exists with OMXCameraAdapterSaravanan Solaiyappan2012-07-251-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [Comment] Build flag is enabled to build both V4L and OMX adapters. Individual adapters can also be choosen for build by setting the appropriate build flag OMAP4_CAMERA_HAL_USES. The camera index will be in the following order while querying the capabilities during bootup: 0 - Primary camera 1 - Secondary camera 2 - USB camera If only USBcamera is connected, the camera index will be 0. [DR] - Change-Id: Ie7165f97b860c13aaa3ad71c8cc12d34baba4cbf Signed-off-by: Solaiyappan Saravanan <saravanan.s@ti.com>
| * | CameraHal: Reduces camera related log printsEmilian Peev2012-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Changes certain prints from LOGE to LOGD to avoid log spam from CameraHAL. Change-Id: I7a2f222fe540aa9277bfef795b155176c331be1f Signed-off-by: Emilian Peev <epeev@mm-sol.com>
| * | CameraHal: Implementation for CAF status callbacksPavel Nedev2012-07-251-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Author: Tyler Luu <tluu@ti.com> 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. Change-Id: I70842a0b8f004873d728ff178ae3a4db12060a7c Signed-off-by: Tyler Luu <tluu@ti.com>
| * | CameraHAL: Fixed events disableAndriy Chepurnyy2012-07-251-64/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use MSB 16 bits for CameraHAL events and LSB 16 bits is for frame types when enable/disable various notifications. Change-Id: Ie878d454d3de8209677fee4d31639156eff877a8 Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
| * | CameraHAL: Calculate UV pointer from YDaniel Levin2012-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to Gralloc DDK changes, from now locking the buffer_handle_t will return only Y pointer initialized, but not UV. In order to access NV12 data directly client app should calculate UV pointer manually. Change-Id: Ic67bdd2a90ab6cb222a8421fcd61ca0703019ea7 Signed-off-by: Daniel Levin <dendy@ti.com>
| * | CameraHAL: Handling some Invalid state operations after stop previewGeorgi Georgiev2012-07-251-0/+6
| | | | | | | | | | | | Change-Id: I940e315b652ab4e5868f40bd6ad6606745c6f7f7
| * | CameraHAL: Improved debug loggingDaniel Levin2012-07-251-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0. Renamed DEBUG_LOG macro to CAMERAHAL_DEBUG and moved it from CameraHal.h into Android.mk. To enable debug logging next variable should be put into $AFS/buildspec.mk: TI_CAMERAHAL_DEBUG_ENABLED := 1 To enable verbose debug logging next variable should be put into $AFS/buildspec.mk: TI_CAMERAHAL_VERBOSE_DEBUG_ENABLED := 1 1. CAMHAL_LOG*A and CAMHAL_LOG*B macros have been united into single CAMHAL_LOG* macro that accepts both variants. 2. Rewritten LOG_FUNCTION_NAME/LOG_FUNCTION_NAME_EXIT macros. Now they do operate on internal FunctionLogger class instance that does function enter/exit logging in constructor/destructor. If LOG_FUNCTION_NAME is used then LOG_FUNCTION_NAME_EXIT can be skipped in source code, in this case destructor will correctly print function exit entry. 3. Added optional printing message timestamps. To enable timestamp printing next variable should be put into $AFS/buildspec.mk: TI_CAMERAHAL_DEBUG_TIMESTAMPS := 1 4. Moved LOG_TAG macro definition from all CameraHAL sources to Android.mk. 5. Added printing message thread ids. 6. Added printing per thread call stack indentation to visualize call hierarchy. 7. Added CAMHAL_ASSERT(condition) and CAMHAL_ASSERT_X(condition,description) macros to assert conditions at runtime and abort process on failure. 8. Added CAMHAL_UNUSED(x) to mark unused variables which are not mistakes. 9. Added next variables to enable debug logging for MessageQueue, that should be put into $AFS/buildspec.mk: TI_UTILS_MESSAGE_QUEUE_DEBUG_ENABLED := 1 TI_UTILS_MESSAGE_QUEUE_DEBUG_FUNCTION_NAMES := 1 Signed-off-by: Daniel Levin <dendy@ti.com> Change-Id: I8ebea607199de621860ada6dfcab9164ba85674a
| * | CameraHAL: RAW + JPEG supportx01180642012-07-251-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds functionality for saving both JPEG and respective RAW buffer. This is done by enabling the video port( to receive RAW ), and sent data to camera_test via RawCallback. NOTE: The raw size is defined by mRawWidth and mRawHight. They set the RAW resolution, which must be the native resolution of the sensor. Signed-off-by: Georgi Georgiev <x0154504@ti.com> Rebase. Signed-off-by: Solaiyappan Saravanan <saravanan.s@ti.com> Signed-off-by: Jean Johnson <a0271255@ti.com> Change-Id: Ie8cb62e86829fafc6cd3dc303830b40dbeb39cb6
| * | CameraHAL: Removed flushBuffers() from base classDaniel Levin2012-07-251-26/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dead code cleanup. Also removed hardcoded numbers from CameraAdapter::CameraCommands enum. Signed-off-by: Daniel Levin <x0155538@ti.com> Change-Id: Ia2fd00bc494653744968ceecdfdaab6bde208fe6
* | | CameraHal: Avoid race condition during recording stopEmilian Peev2012-10-151-2/+2
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - A race condition is possible when recording is stopped. 'BaseCameraAdapter::stopVideoCapture()' is clearing 'mVideoBuffersAvailable'. A delayed video frame from 'AppCallbackNotifier' can return afterwards though and then try to query the already empty 'KeyedVector'. This will result in a segfault. Solution is to move the vector reset away from 'stopVideoCapture()' and in to 'startVideoCapture()' where it is needed. Bug: 7021214 Change-Id: Ic234189b49e35c990b3af70bd713a12cb762362c Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* | camera: fix deadlock because of mStateSwitchLockTyler Luu2012-03-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | When OMXCameraAdapter::UseBuffersPreview() is failing mStateSwitchLock must be unlocked. b/6046798 Change-Id: Ie9ecccc2e23b0a31b2972beb0411faca279d5d0c Signed-off-by: Daniel Levin <dendy@ti.com> Signed-off-by: Tyler Luu <tluu@ti.com>
* | camera: prevent possible deadlock scenarioTyler Luu2012-03-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hold scope of returnFrame lock for just the calculation of refCount. Otherwise, we could have a scenario where endImageCapture and stopRecording could cause a deadlock competing for mReturnFrameLock and mLock. Issue arises mainly because endImageCapture is signalled from fillThisBuffer which stopRecording will need to get into. Make sure mEventQ has a message before calling get() since read on the pipe will block with notifyEvent holding mLock. Change-Id: I3a125711632fa311fd794e300cd5008321a84c40 Signed-off-by: Tyler Luu <tluu@ti.com>
* | CameraHal: Reduces Camera logcat printsEmilian Peev2012-02-111-1/+7
| | | | | | | | | | Change-Id: Id32ad1b882a76f091866583b15ae0ca2929bacef Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* | CameraHal: Implementation for CAF status callbacksTyler Luu2012-02-011-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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