summaryrefslogtreecommitdiffstats
path: root/camera/BufferSourceAdapter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* CameraHal: Release reprocess input buffersEmilian Peev2012-11-261-1/+6
| | | | | | | | | | | | | - Currently reprocess buffers are getting acquired from a 'BufferQueue' via calls to 'update_and_get_current()'. Those buffers are not getting properly released though. Depends on frameworks/av I050800fa: http://review.omapzoom.org/#/c/30198/ Change-Id: I841a78063bcf18f7ecf3882311ecc9dee3be6745 Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* CameraHal: Use GRALLOC_USAGE_PRIVATE_0 for UYVY allocationVladimir Petrov2012-11-261-0/+1
| | | | | | | | | | - Add missing usage flag in case of UYVY BS buffer allocation. Should be squashed with change Ia82e0836 if porting to another branch: a4c9c61 CameraHal: Add support for UYVY reprocessing Change-Id: I6a28377c1941504639b3375989c6f41fad55871c Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
* CameraHal: Add support for UYVY reprocessingEmilian Peev2012-11-261-2/+5
| | | | | | | | | | | NOTE: Currently UYVY is mapped to 'CameraParameters::PIXEL_FORMAT_YUV422I' which is not entirely correct. The Google pixelformat expects YUYV ordering of the components. Change-Id: Ia82e08363d6804e51c447eb845da2ca23fc29ae9 Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
* CameraHal: Add support for reprocessing with buffer bordersEmilian Peev2012-11-261-0/+6
| | | | | | | | | | | | | | | | - The header of the processed buffer should be set correctly in order for the camera component to properly match the start of the valid data. Depends on frameworks/av change I788dd738: http://review.omapzoom.org/#/c/29677/ Depends on hardware/libhardware change Ie37ab311: http://review.omapzoom.org/#/c/29676/ Change-Id: I003b7cfae41ddf6bb46661e0803a4fb1b60a99e6 Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
* CameraHal: Add error handling during frame callbacksEmilian Peev2012-11-261-6/+15
| | | | | | | | | | | | - ST can be abandoned by the client, so we need to handle this case inside 'handleFrameCallback' without crashing. - 'freeBufferList()' should only release buffers associated with it. Change-Id: Ib052aa6a6c2b5cb495d4e8bcc804cd3a3b87c95f Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
* CameraHal: Allocate buffers when source is setTyler Luu2012-11-261-7/+4
| | | | | | | | | | | | | | | | - Allocate the buffers for a particular surface when it is set. This allows applications to set multiple surfaces before capturing or reprocessing, so they don't have to take the penalty of buffer allocation during. - Partialy revert change I0c1b8854. Depends on hardware/libhardware change I01831e05: http://review.omapzoom.org/#/c/28152/ Change-Id: I13aa2b19387e2a21f8ca08203b132154c14d481b Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
* CameraHal: Use GRALLOC_USAGE_PRIVATE_0 for BayerVladimir Petrov2012-11-261-1/+1
| | | | | | | | - In Bayer format set GRALLOC_USAGE_PRIVATE_0 usage flag to the graphics buffer allocator. Change-Id: I629803110ec6f18cc824c75c6d81450bb108dcff Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
* CameraHal: Check return frames count before waiting on conditionEmilian Peev2012-11-261-3/+0
| | | | | | | | | | | | - The Thread responsible for retrieving free buffers from the tapout is possible to miss some incoming signals and wait while buffers are available in the ST. Solution is to count all outgoing buffers and not wait on the condition when buffers are available. Change-Id: I31526dd334a08f52f0c6069cea847ae14e2cffbc Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
* CameraHal: Add getBuffers() method to BufferSourceAdapterSundar Raman2012-11-261-0/+116
| | | | | | | | | - Added a method in BufferProvider which can provide the CameraBuffer list Change-Id: Ia9ea8e0ac7e59e969fd5bedcfaf057f3607ab963 Signed-off-by: Sundar Raman <a0393242@ti.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
* CameraHal: Add support for setting multiple tap in/outsTyler Luu2012-11-261-6/+27
| | | | | | | | | | | | | | | | | - Adding support for setting multiple tap in and tap out points that the application can set at any time. Applications need to provide name of tap-in and tap-outs with their shot config for us to find the tap-in or tap-out point from the vector we are keeping. - Patch for releasing tap in/outs to follow Depends on frameworks/av change Ia21c4a26: http://review.omapzoom.org/#/c/28899/ Change-Id: I6fa91de68c7bf71525596ee5e1a5ebb2a7b3b5da Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
* CameraHal: Add support for matching tap in/out surface by nameTyler Luu2012-11-261-0/+13
| | | | | | | | | | | | | | | | - API has changed so applications need to specify the name of the tap in/out surfaces they want to use for a particular shot/reprocess call. Depends on frameworks/av change I7c8c17cf: http://review.omapzoom.org/#/c/28898/ Depends on hardware/libhardware change I859c6e87: http://review.omapzoom.org/#/c/28141/ Change-Id: I785286be77970679f8d9cc8bfd9befe4a63191ac Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
* CameraHal: Check if BS buffer is not in listVladimir Petrov2012-11-261-0/+9
| | | | | | | | | - Check that passed buffer is in current buffer source list. If no, return the buffer to caller instead of getting out of range. Change-Id: I3acef6514049d1e1009f91ec4ec62688974223a1 Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
* Merge p-jb-release into d-jb-releaseKeith Deacon2012-11-261-1/+17
|\ | | | | | | Change-Id: I649b0c53d1c0e8f56e059a3cb24a38089d8fccc4
| * camera: bsa: Calculate height for allocationTyler Luu2012-10-101-1/+17
| | | | | | | | | | | | | | | | | | | | | | For allocating buffer list, calculate the height from stride, size, and format instead of using the passed height value. Image buffers were originally allocated from just size parameter when we were using MemoryManager. Now, ANW just uses width, height, and format. Change-Id: I1c743798426ea1e529e7c9ff6f09530e07bc1b86 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
* | camera: bsa: Set crop before enqueueingTyler Luu2012-11-261-0/+9
| | | | | | | | | | | | | | | | | | | | - Set the crop rectangle for surface texture, so surface texture can compute transform matrix that will be used by applications. Change-Id: I6e245c99ac3196518d8a9ee83c162d3ce380b7e9 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
* | Merge p-jb-release into d-jb-releaseKeith Deacon2012-11-261-7/+9
|\| | | | | | | | | | | | | Conflicts: camera/inc/CameraHal.h Change-Id: I826ef084fe01e8b5682d8a78c7cec76b39043d45
| * CameraHal: Avoid metadata leak in non-CPCam use caseEmilian Peev2012-10-101-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | - The metadata was not getting released properly in non-CPCam use cases. This patch adds the extended metadata as part of 'CameraMetadataResult' which is reference counted and will get released correctly in all use-cases. Change-Id: I6a5d88941c1077c25df803b239979d808aa603f5 Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Daniel Levin <dendy@ti.com>
* | camera: Fill format field in BufferProvidersTyler Luu2012-11-261-1/+2
| | | | | | | | | | | | | | | | | | | | Fill format field in the BufferProviders (MemoryManager, ANativeWindowAdapter, BufferSourceAdapter), so the format of the buffer is known to the consumers. Change-Id: I7b5fbb3e7da107735de98669d3d9889a4bff6097 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
* | camera: Common functions for size calculation and image formatTyler Luu2012-11-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Use common functions for calculating buffer size and getting image format constant since they are used in several places in CameraHal. The common functions are implemented as static functions in the CameraHal class. Change-Id: I242435ebcdebea0bc9a7452a5dc38e3f96f5be11 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com> Signed-off-by: Daniel Levin <dendy@ti.com>
* | camera: bsa: Fix releasing of threadsTyler Luu2012-11-261-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Threads in buffer source adapter were not being released correctly, which lead to them being orphaned. Previous logic relied on the Thread destructors getting called to wake up the threads for them to exit, but the destructors were not getting called since it still had child threads. This patch implements the virtual requestExit function for each Thread class. Each implementation wakes its respective thread if it is waiting, so the thread can exit. Change-Id: I95c42a05ce76d6241b073c5927ecb81365562066 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
* | Camera HAL: BSA: Move mLock in handleFrameCallbackTyler Luu2012-11-261-2/+2
|/ | | | | | | | | Move mLock to protect mBuffers check in handleFrameCallback. need to protect the check in case mBuffers is freed. Change-Id: I1849cca245c2ed57380e615cd916db2d7d9400b4 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
* Camera: Rework CPCam to preserve HAL ABI compatibilityDaniel Levin2012-10-101-4/+4
| | | | | | | | | | | | | Implemented initialization of camera_device_extended_ops_t. Moved take_picture_with_parameters into separate function. Implemented calling CPCam surface callbacks via preview_stream_extended_ops_t. The default dummy functions always do no-op and return INVALID_OPERATION. Change-Id: I00efd08544ea5a0c7b22c7a2135a332871f06792 Signed-off-by: Daniel Levin <dendy@ti.com>
* Camera: Use share buffer allocator for metadataEmilian Peev2012-10-101-4/+8
| | | | | | | | | | | 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>
* CameraHAL: Moved Camera HAL sources out of namespace androidDaniel Levin2012-07-251-21/+23
| | | | | | | | | | | | | | | | | | | | | | | | 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: Wrapped sources with OMAP_ENHANCEMENT_* macrosDaniel Levin2012-07-251-0/+3
| | | | | | | | | | | | | | | | | | | 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>
* CameraHal: Add support for BAYER reprocessingTyler Luu2012-07-251-4/+11
| | | | | | | | | | 1. Add support for allocating bitstream buffers for bayer format through buffersourceadapter 2. Add support for setting up reprocessing port (video-in) in OMXCameraAdapter for bayer format Change-Id: I0d9c1d6ec4ca09b4f9d19b36321abef0495d7405 Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* camera: buffersource: changes to nv12 allocationTyler Luu2012-07-251-9/+27
| | | | | | | | | | | | Adapting NV12 system heap allocations to gralloc changes. NV12-1D format is no longer supported. Instead, we are using existing NV12 format with the GRALLOC_USAGE_PRIVATE_0 usage flag to signal to gralloc we want allocations to come from the system heap. Change-Id: I421a27b8cc0bb0e9dfe3b97290fe7114127be72f Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHAL: Initial Camera Metadata changeTyler Luu2012-07-251-0/+6
| | | | | | | | | | Parse through extra data from omx camera and fill in CameraMetadata class. Send the metadata to BufferSource. Change-Id: I5eb9b4b59404c9e1aac9052b2301d03bffe8dc4e Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
* camera: add reprocess() functionalityTyler Luu2012-07-251-2/+2
| | | | | | | | | | | | | | 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>
* camera: initial implementation for BufferSourceTyler Luu2012-07-251-0/+758
Initial implementation to accept and use a BufferSource (SurfaceTexture) object for buffer management and datacallbacks. Change-Id: I0c1b8854f162eb3ea00c568a56c485d67f41ebca Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>