CPCam: Reconcile CPCam add-on for JB

This patch adapts CPCam add-on to changes made in Camera framework
in JB. Focus move needs to be added to ICS as a result.

Change-Id: I511ee65f63ee9609e6025c2196c55cd075f0a2e5
Signed-off-by: Tyler Luu <tluu@ti.com>
Camera: Use share buffer allocator for metadata

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>
camera_test: SurfaceTexture metadata changes

Use camera_metadata_t structure instead of CameraMetadata class.

Change-Id: Id48b1653fdf7ff2305b7c0edc8246b1a4c01c25c
Signed-off-by: Emilian Peev <epeev@mm-sol.com>
Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
CPCam: Add CPCamMetadata

Added new class CPCamMetadata.
Removed obsolete class CPCamUtils.

Change-Id: I69b652ae827ffc583c69a678d8efce96ed9e75ce
Signed-off-by: Emilian Peev <epeev@mm-sol.com>
Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
CPCam: Introducing CPCamBufferQueue

Introducing a new class that CPCam applications should use for buffer
management instead of SurfaceTexture or BufferQueue directly.

In JB, this class be backed by BufferQueue. In ICS, this class will
continue to be backed by SurfaceTexture.

Change-Id: Icc275017674ecc38879c58db8ce3403e5ad363ba
Signed-off-by: Tyler Luu <tluu@ti.com>
CPCam: Change setBufferSource to use CPCamMetadata

This patch changes setBufferSource to take CPCamMetadata as input
instead of SurfaceTexture. As a result, since SurfaceTexture will no
longer be used, we are also removing CPCamSurfaceTextureCreator

Change-Id: I2d196b9d76f848c1fe274e980d013fd5ca8c82ac
Signed-off-by: Tyler Luu <tluu@ti.com>
CPCam: CPCamMetadata portability changes

Adapting CPCam metadata Java and JNI so it will be portable between ICS
and JB.

JNI:
1. Modifications to use BufferQueue instead of SurfaceTexture
2. Logging macros rename: LOG* -> CAMHAL_LOG*

Java:
1. Pass slot index in getMetadata() call
2. Use CPCamBufferQueue instead of SurfaceTexture

Change-Id: I30685761ee5c5da118f5b83e5470825551eefdda
Signed-off-by: Tyler Luu <tluu@ti.com>
camera_test: Add OMAP_ENHANCEMENT_BURST_CAPTURE

Wrap sections appropiately with OMAP_ENHANCEMENT_BURST_CAPTURE,
so we can build camera_test when OMAP_ENHANCEMENT_BURST_CAPTURE
is not defined

Change-Id: I1b07e4709ce29861eae15a7aa0168aa6a8f7fe0b
Signed-off-by: Tyler Luu <tluu@ti.com>
surfacetexture_test: Fix build for JB

Fix include files for surfacetexture_test.

Change-Id: Id0d3ec7eafe9fc1bcebf3b4b35477e7b25aeba01
Signed-off-by: Tyler Luu <tluu@ti.com>
camera_test: Refactor BufferSourceThread and BufferSourceInput

Refactoring BufferSourceThread and BufferSourceInput to be base classes
and deriving from them classes for both SurfaceTexture and BufferQueue.
The BufferQueue implementation will be used for JB.

Change-Id: I520deba143f28e49bd32cea9e79b368d0f0f1fc6
Signed-off-by: Tyler Luu <tluu@ti.com>
camera_test: add onHandled to BufferSourceThread

BufferQueue needs to release the buffer after handling

Change-Id: I3849ac4b613b5f40dc3a5bd92415b6918db475db
Signed-off-by: Tyler Luu <tluu@ti.com>
Camera: Take picture with parameters in CPCam

takePictureWithParameters() is now a separate method in Camera
interface.

Change-Id: I585d2fc1ded3e9ed44b4a996ec7f9ee445c60ec9
Signed-off-by: Daniel Levin <dendy@ti.com>
Camera: Take picture with parameters in camera_test

takePictureWithParameters() is now a separate method in Camera
interface.

Change-Id: I9cda61d2d1e80d193047cb4fceabdbbea27a5191
Signed-off-by: Daniel Levin <dendy@ti.com>
Camera: Link to libcpcamcamera_client

The ShotParameters is now a part of separate static library
libcpcamcamera_client to preserve HAL binary compatibility.

Change-Id: Iacbe28e0b6e30ab1c18de89f51497632cbb68033
Signed-off-by: Daniel Levin <dendy@ti.com>
CameraHal: CTS preview callback fix

- Repeated preview restarts might fail to enable
  preview callbacks properly. This is due to a
  check which only enables them when preview is
  on. This patch modifies the condition a bit
  in order to cover the cases where the preview
  is correctly initialized and a valid preview
  surface is available.
- Should fix an issue with CTS test
  #testPreviewPictureSizesCombination.

Change-Id: I9347a6da875ae001b90c96be898582ff6ed9ba4f
Signed-off-by: Emilian Peev <epeev@mm-sol.com>
Camera: Rework CPCam to preserve HAL ABI compatibility

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>
Merge branch "Camera: Rework CPCam to preserve HAL ABI compatibility" into p-jb-release

Change-Id: I0335619e4522f840566987fbd5806a62b5c1f279
Merge branch 'p-jb-release' of git://git.omapzoom.org/platform/hardware/ti/omap4xxx into jellybean