unified-camera-hal:unified-camera-hal.git
5 years agoAdded prefix for module name to omit mess with existing Camera HAL binaries
Daniel Levin [Sun, 18 Dec 2011 17:32:29 +0000 (11:32 -0600)]
Added prefix for module name to omit mess with existing Camera HAL binaries

5 years agoForbidd comparison between different enums
Daniel Levin [Mon, 23 Jan 2012 17:13:20 +0000 (19:13 +0200)]
Forbidd comparison between different enums

From now on comparison between different enums is disallowed.

This should help to improve visibility of invalid comparations
between OMX core and derived enums.

Change-Id: Iad7fae54947c83de7e9f3204aefa9d4517e23ef3
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded safe operations for OMX_TI_SENFACING_TYPE enum
Daniel Levin [Mon, 23 Jan 2012 19:37:09 +0000 (21:37 +0200)]
Added safe operations for OMX_TI_SENFACING_TYPE enum

Change-Id: I4a653ccd29a2b2a1d50c94bb815fec42fd0b2eb6

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded safe operations for OMX_TI_STEREOFRAMELAYOUTTYPE enum
Daniel Levin [Mon, 23 Jan 2012 19:24:04 +0000 (21:24 +0200)]
Added safe operations for OMX_TI_STEREOFRAMELAYOUTTYPE enum

Change-Id: I1f48262b510d500b29c94b091ff933fe1bd163dd

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded safe operations for OMX_TI_AUTOCONVERGENCEMODETYPE enum
Daniel Levin [Mon, 23 Jan 2012 19:20:07 +0000 (21:20 +0200)]
Added safe operations for OMX_TI_AUTOCONVERGENCEMODETYPE enum

Change-Id: I7895eb90e0323ce9fb4673668f210888a85e4666

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded safe operations for OMX_ISONOISEFILTERMODETYPE enum
Daniel Levin [Mon, 23 Jan 2012 19:15:53 +0000 (21:15 +0200)]
Added safe operations for OMX_ISONOISEFILTERMODETYPE enum

Change-Id: I4c9016e1dcabb38e661312c0928dcb2e02b6b11d

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded safe operations for OMX_TI_CAMERAVIEWTYPE enum
Daniel Levin [Mon, 23 Jan 2012 19:13:15 +0000 (21:13 +0200)]
Added safe operations for OMX_TI_CAMERAVIEWTYPE enum

Change-Id: I26b163c9bd45b54abfef5b170c2fda36161f1cb3

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded safe operations for OMX_BRACKETMODETYPE enum
Daniel Levin [Mon, 23 Jan 2012 19:11:16 +0000 (21:11 +0200)]
Added safe operations for OMX_BRACKETMODETYPE enum

Change-Id: I10cadaaf03cff1e5df1de2e7a45885c5eb994138

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded safe operations for OMX_SCENEMODETYPE enum
Daniel Levin [Mon, 23 Jan 2012 19:09:06 +0000 (21:09 +0200)]
Added safe operations for OMX_SCENEMODETYPE enum

Change-Id: I6da573a49b1deab22975ff9484fdef7e6bdb2dc3

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded safe operations for OMX_COMMONFLICKERCANCELTYPE enum
Daniel Levin [Mon, 23 Jan 2012 19:07:14 +0000 (21:07 +0200)]
Added safe operations for OMX_COMMONFLICKERCANCELTYPE enum

Change-Id: I76d271faa72480a64d9809175208cf7b51eb6d6a

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded safe operations for OMX_SENSORSELECT enum
Daniel Levin [Tue, 24 Jan 2012 16:23:10 +0000 (18:23 +0200)]
Added safe operations for OMX_SENSORSELECT enum

Change-Id: I0ffb98574a916f46b298a899a807b8070fe6b4aa

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded safe operations for OMX_INDEXTYPE enum
Andriy Chepurnyy [Fri, 20 Jan 2012 17:06:22 +0000 (19:06 +0200)]
Added safe operations for OMX_INDEXTYPE enum

Change-Id: Ia05adc6ca15bd92a1b4027c0255e24f8428f2862

Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded safe operations for OMX_IMAGE_FOCUSCONTROLTYPE enum
Daniel Levin [Mon, 23 Jan 2012 16:55:47 +0000 (18:55 +0200)]
Added safe operations for OMX_IMAGE_FOCUSCONTROLTYPE enum

Change-Id: Ib88fa1c382364dff679ed65f9f585e1866e5542f

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded safe operations for OMX_IMAGE_FLASHCONTROLTYPE enum
Andriy Chepurnyy [Fri, 20 Jan 2012 14:02:34 +0000 (16:02 +0200)]
Added safe operations for OMX_IMAGE_FLASHCONTROLTYPE enum

Change-Id: I9868f7474cbbf1bfb718e1d556ee7a9f70e08858

Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded safe operations for OMX_IMAGE_CODINGTYPE enum
Andriy Chepurnyy [Fri, 20 Jan 2012 12:04:37 +0000 (14:04 +0200)]
Added safe operations for OMX_IMAGE_CODINGTYPE enum

Change-Id: Ic0a17293aa7e42f7bd71bb8fd576d9e5ca2057a6

Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded safe operations for OMX_FOCUSSTATUSTYPE enum
Andriy Chepurnyy [Fri, 20 Jan 2012 16:02:08 +0000 (18:02 +0200)]
Added safe operations for OMX_FOCUSSTATUSTYPE enum

Change-Id: I457259b5f82c861cfe5e8604681f679cf5738649

Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded safe operations for OMX_EXPOSURECONTROLTYPE enum
Andriy Chepurnyy [Fri, 20 Jan 2012 15:58:33 +0000 (17:58 +0200)]
Added safe operations for OMX_EXPOSURECONTROLTYPE enum

Change-Id: Ia0c575f33a5b1a5b64f136586ab42976cc0ab1b8

Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded safe operations for OMX_WHITEBALCONTROLTYPE enum
Andriy Chepurnyy [Fri, 20 Jan 2012 15:51:36 +0000 (17:51 +0200)]
Added safe operations for OMX_WHITEBALCONTROLTYPE enum

Change-Id: Idd3bddae214005b606aa10ec9e6e985c61fb2b09

Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoRemoved WB and Exposure face priorities
Daniel Levin [Mon, 23 Jan 2012 15:41:17 +0000 (17:41 +0200)]
Removed WB and Exposure face priorities

WB face priority is ignored and not used by Ducati currently.

Exposure face priority is enabled by default when face detection
is enabled and exposure mode set ti auto.

Change-Id: Ia669d73db4e2a05c9296ac7a612f9c60ecd7bf30
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded safe operations for OMX_IMAGEFILTERTYPE enum
Andriy Chepurnyy [Fri, 20 Jan 2012 10:28:44 +0000 (12:28 +0200)]
Added safe operations for OMX_IMAGEFILTERTYPE enum

Change-Id: I10cf3370674df1e1c880581b7d02a7ba719c4228

Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded template getLUTvalue_OMXtoHAL method
Andriy Chepurnyy [Fri, 20 Jan 2012 12:35:33 +0000 (14:35 +0200)]
Added template getLUTvalue_OMXtoHAL method

Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
5 years agoInitialize mParameters3A using defaults values.
Andriy Chepurnyy [Thu, 19 Jan 2012 14:50:30 +0000 (16:50 +0200)]
Initialize mParameters3A using defaults values.
Added assert for proper initialization check.

Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
5 years agoAdded safe operations for OMX_COLOR_FORMATTYPE enum
Andriy Chepurnyy [Tue, 17 Jan 2012 18:55:56 +0000 (20:55 +0200)]
Added safe operations for OMX_COLOR_FORMATTYPE enum

Change-Id: I56b09abc57dd4fcafd7eb02eea73be09e499d7e4

Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded safe operations for OMX_EVENTTYPE enum
Andriy Chepurnyy [Tue, 17 Jan 2012 17:31:45 +0000 (19:31 +0200)]
Added safe operations for OMX_EVENTTYPE enum

Change-Id: I6426dd6a8900d18a9faf5234545f25010256ce12

Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded safe operations for OMX_EXTRADATATYPE enum
Andriy Chepurnyy [Tue, 17 Jan 2012 16:14:06 +0000 (18:14 +0200)]
Added safe operations for OMX_EXTRADATATYPE enum

Change-Id: I8857411cb0c23ffae691b5a265bd450efaa674ff

Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded safe operations for OMX_ERRORTYPE enum
Andriy Chepurnyy [Tue, 17 Jan 2012 15:40:35 +0000 (17:40 +0200)]
Added safe operations for OMX_ERRORTYPE enum

Change-Id: I6c308416da495941e7e9d13073c674254e048ae5

Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
5 years agoAdded safe operations for OMX_STATETYPE enum
Andriy Chepurnyy [Fri, 20 Jan 2012 14:34:37 +0000 (16:34 +0200)]
Added safe operations for OMX_STATETYPE enum

Change-Id: I2e852c3d5049e9f7a9945ee6560931b05e871eef

Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
5 years agoRearranged OMX include headers
Daniel Levin [Mon, 23 Jan 2012 18:25:04 +0000 (20:25 +0200)]
Rearranged OMX include headers

Moved all OMX includes directly into internal OmxTools.h, that is
supposed to be included from all other OMX Camera Adapter sources.

Change-Id: I43b13c75882251b9902bdbec830e106518c580de
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded template class for type safe OMX enums conversions
Daniel Levin [Tue, 17 Jan 2012 13:58:26 +0000 (15:58 +0200)]
Added template class for type safe OMX enums conversions

Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
5 years agoMute warning about conversion from PixelFormat to OMX_COLOR_FORMATTYPE
Daniel Levin [Thu, 19 Jan 2012 19:49:07 +0000 (21:49 +0200)]
Mute warning about conversion from PixelFormat to OMX_COLOR_FORMATTYPE

Change-Id: Iaaec2459453adb7f6a26c473d8c3ed93ae505135
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoFixed warning about unsigned integer comparison
Daniel Levin [Thu, 19 Jan 2012 19:48:21 +0000 (21:48 +0200)]
Fixed warning about unsigned integer comparison

Change-Id: If17488ec39e744f278c2b31bfbf83863eae84913
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoFixed sending face detection results
Daniel Levin [Thu, 19 Jan 2012 13:13:56 +0000 (15:13 +0200)]
Fixed sending face detection results

When detected face cound reached zero at least one metadata
callback should be sent to CameraService, otherwise application
will think that face is still present in frame.

Also optimized the code by sending only one metadata callback
with number of faces 0;

Change-Id: I5a2dd2968ea430d361600d8d58017814b1456701
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoStream asserts
Daniel Levin [Fri, 23 Dec 2011 19:27:15 +0000 (13:27 -0600)]
Stream asserts

Implemented stream logging in CAMHAL_ASSERT() macro instead of printf style.

Macro can be used in two ways:
1. Simple.  CAMHAL_ASSERT(a >= 0);
2. Verbose. CAMHAL_ASSERT(a >= 0) << "Invalid a value:" << a;

Optimization to avoid assert condition calculation in runtime is done by
using __builtin_expect() when entering Logger instance and attempt to write
assert message using overloaded operator <<.

Added Makefile variable TI_OMAP4_CAMERAHAL_DONT_USE_ASSERTS that can be used
to disable all assert in Camera HAL for optimization purposes.

Signed-off-by: Daniel Levin <dendy@ti.com>
Change-Id: Iaad1759a7522025f6c9e3cca9bc30a7cf7384603

5 years agoFixed printing error message at state switch
Daniel Levin [Mon, 16 Jan 2012 11:33:36 +0000 (13:33 +0200)]
Fixed printing error message at state switch

Change-Id: I1b06394a5c86954960e2a05c2408b037654680a5

5 years agoFixed working with raw frames
Daniel Levin [Fri, 16 Dec 2011 19:33:19 +0000 (13:33 -0600)]
Fixed working with raw frames

Change-Id: I698288cc9ae2c561c8b6771427126470ea50d85c

5 years agoRemoved image buffer handles. Dead code cleanup.
Daniel Levin [Sat, 17 Dec 2011 23:16:15 +0000 (17:16 -0600)]
Removed image buffer handles. Dead code cleanup.

5 years agoRemoved resetFrameRefCount(). Dead code cleanup.
Daniel Levin [Sat, 17 Dec 2011 03:17:19 +0000 (21:17 -0600)]
Removed resetFrameRefCount(). Dead code cleanup.

5 years agoMoved logging to streaming
Daniel Levin [Sat, 10 Dec 2011 23:31:41 +0000 (17:31 -0600)]
Moved logging to streaming

Reritten all logging occurrences with CAMHAL_LOG* macros to
streaming operators for all Camera HAL sources.

Change-Id: Ibf2a168fe53db7c5d9adef7e4b61b96da18b066b

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoType safe 3A settings
Daniel Levin [Thu, 15 Dec 2011 01:26:04 +0000 (19:26 -0600)]
Type safe 3A settings

Change-Id: I8b5162a197a97e5660f2aebdb483e3cfaab96018
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoRenamed CameraHal into Device
Daniel Levin [Wed, 14 Dec 2011 03:34:32 +0000 (21:34 -0600)]
Renamed CameraHal into Device

Change-Id: Iffe8c4832fb07d0a71fab0bb085114d991b57c34
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoUse CallbackMemory for metadata callback routine
Daniel Levin [Wed, 14 Dec 2011 01:56:37 +0000 (19:56 -0600)]
Use CallbackMemory for metadata callback routine

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoRemoved shared memory usage while Jpeg encoding
Daniel Levin [Wed, 14 Dec 2011 01:54:32 +0000 (19:54 -0600)]
Removed shared memory usage while Jpeg encoding

Allocating shared camera memory is useless in Jpeg encoding case
because it is used only internally for Camera HAL purposes.

Replaced with raw malloc()/free() allocators.

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoReplaced mDevice reference with device() accessor
Daniel Levin [Wed, 14 Dec 2011 01:22:58 +0000 (19:22 -0600)]
Replaced mDevice reference with device() accessor

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded callback wrappers
Daniel Levin [Mon, 12 Dec 2011 00:42:22 +0000 (18:42 -0600)]
Added callback wrappers

Simplified triggering callbacks from AppCallbackNotifier by adding
appropriate wrappers that will automatically pass proper memory
handles and user cookie.

Change-Id: I3acbb891ae599241db4eaf7d3291e5ce8fc06e21
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoRewritten video buffer callbacks
Daniel Levin [Mon, 12 Dec 2011 21:22:56 +0000 (15:22 -0600)]
Rewritten video buffer callbacks

Removed duplicated entries for AppCallbackNotifier video buffers.
Now video buffers are accessed directly from Device instance.

Also optimized video buffers metadata allocation by merging them
into single CallbackMemory mVideoMetadataMemory instance.

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoVideo metadata
Daniel Levin [Mon, 12 Dec 2011 00:12:21 +0000 (18:12 -0600)]
Video metadata

Added video_metadata_t header to public Camera HAL interfaces
for compatibility with DOMX codecs source code.

Added CameraVideoMetadata class as C++ wrapper over C
video_metadata_t type for type safety reasons.

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded CallbackMemory
Daniel Levin [Tue, 13 Dec 2011 18:32:27 +0000 (12:32 -0600)]
Added CallbackMemory

Added CallbackMemory class that acts as crossplatform allocator
for Camera HAL shared memory for callback purposes.

Created implementations for GB/HC via Binder MemoryHeap and
for ICS via camera_memory_t.

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoType safe image frames
Daniel Levin [Sun, 11 Dec 2011 19:27:14 +0000 (13:27 -0600)]
Type safe image frames

Change-Id: I6785e7ebdba114155ac9ec9512aee663c13f3067

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoFixup for: Switch to Idle before loading capabilities
Daniel Levin [Sun, 11 Dec 2011 19:39:30 +0000 (13:39 -0600)]
Fixup for: Switch to Idle before loading capabilities

Implemented switching to Idle state before loading
OMX capabilities.

Corresponding patch for DOMX:
http://review.omapzoom.org/16036

Change-Id: Iedd9f92807ae999b5940b1c938b7a9fbe07526e9
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoType safe buffers
Daniel Levin [Sun, 11 Dec 2011 19:11:33 +0000 (13:11 -0600)]
Type safe buffers

Implemented template based type safe buffers for different use-cases.
Because buffers are used for different use-cases they are not
compatible between each other.

Separate buffer types are created for next use-cases:
- preview
- image
- video
- raw data
- measurement

Created implementation for ICS mainline:
- preview     - Gralloc memory
- image       - TILER 1D memory
- video       - Gralloc memory
- raw data    - TILER 1D memory
- measurement - TILER 1D memory

Created separate abstract interfaces to allocate:
- preview buffers (implemented by DisplayAdapter)
- TILER buffers 1D/2D (implemented by MemoryManager)

Complemently moved allocated preview buffers from ANativeDisplayAdapter
to Device. Now to fetch buffer info Device instance should be requested
explicitly with buffer type and buffer index.

Typed buffers are currently implemented only at Device,
ANativeWindowDisplayAdapter, AppCallbackNotifier and MemoryManager side.
CameraAdapter's frame management is not affected, casting between
unsafe void* and typed buffers is done transparently at buffer provider
implementation side.

Change-Id: Idfe23b67ea50504a9d9a5e8969076572e7bc333f
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoPixelFormat
Daniel Levin [Sun, 11 Dec 2011 19:00:35 +0000 (13:00 -0600)]
PixelFormat

PixelFormat class now used for interface Camera HAL purposes
instead of mix of Android CameraProperties c-string tokens and
OMX_COLOR_FORMATTYPE enum. Added conversion to and from
Android CameraProperties formats and OMX formats.

Also moved common pixel format based function
calculateBufferLength() and bytesPerPixelForPixelFormat() into
Tools.h/Tools.cpp sources.

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded logging for frame types
Daniel Levin [Fri, 16 Dec 2011 02:39:13 +0000 (20:39 -0600)]
Added logging for frame types

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded logging for CameraAdapter commands
Daniel Levin [Fri, 16 Dec 2011 02:36:43 +0000 (20:36 -0600)]
Added logging for CameraAdapter commands

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded logging for geometry types
Daniel Levin [Sun, 11 Dec 2011 01:48:31 +0000 (19:48 -0600)]
Added logging for geometry types

5 years agoAdded logging for OMX types
Daniel Levin [Sun, 11 Dec 2011 00:54:07 +0000 (18:54 -0600)]
Added logging for OMX types

Added logging for:
- OMX_BOOL
- OMX_VERSIONTYPE
- OMX_STATETYPE
- OMX_ERRORTYPE
- OMX_EXTRADATATYPE
- OMX_EVENTTYPE
- OMX_COLOR_FORMATTYPE
- OMX_IMAGEFILTERTYPE
- OMX_WHITEBALCONTROLTYPE
- OMX_EXPOSURECONTROLTYPE
- OMX_FOCUSSTATUSTYPE
- OMX_COMMONFLICKERCANCELTYPE
- OMX_SCENEMODETYPE
- OMX_BRACKETMODETYPE
- OMX_TI_CAMERAVIEWTYPE
- OMX_ISONOISEFILTERMODETYPE
- OMX_TI_AUTOCONVERGENCEMODETYPE
- OMX_TI_STEREOFRAMELAYOUTTYPE
- OMX_TI_SENFACING_TYPE
- OMX_IMAGE_CODINGTYPE
- OMX_IMAGE_FLASHCONTROLTYPE
- OMX_IMAGE_FOCUSCONTROLTYPE
- OMX_INDEXTYPE

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded logging for OMXCameraAdapter types
Daniel Levin [Fri, 16 Dec 2011 02:40:05 +0000 (20:40 -0600)]
Added logging for OMXCameraAdapter types

Added logging for:
- CaptureMode
- IPPMode
- BrightnessMode

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded logging for status_t
Daniel Levin [Sun, 11 Dec 2011 00:53:44 +0000 (18:53 -0600)]
Added logging for status_t

5 years agoCrossplatform face detection
Daniel Levin [Sun, 11 Dec 2011 18:43:27 +0000 (12:43 -0600)]
Crossplatform face detection

Implemented crossplatform interface for face detection.
Added internal optimized types FaceInfo/FaceDetectionResult to
store face detection results came from Ducati.

Created implementation for ICS mainline by using
camera_frame_metadata_t interface. Optimized original
implementation by removing useless allocation for
camera_frame_metadata_t and camera_face_t array.
New implementation operates on values on stack.

Also optimized CameraHalEvent class to get rid of useless memory
allocations for event data.

Also added OmxTools.h/OmxTools.cpp sources for common OMX routines.
Moved extra data lookup helper function into OmxTools sources.

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoAdded StringEnum
Daniel Levin [Fri, 24 Feb 2012 14:58:57 +0000 (16:58 +0200)]
Added StringEnum

Change-Id: I6bb88a9318f7f5cc737d3baafafc971aa08976b2

5 years agoAdded Utils::Range
Daniel Levin [Fri, 24 Feb 2012 14:55:33 +0000 (16:55 +0200)]
Added Utils::Range

Change-Id: Ia11ec4b2ae637bca44f7d980668666bc8a1fe39a

5 years agoAdded Utils::StringRef
Daniel Levin [Fri, 24 Feb 2012 14:54:45 +0000 (16:54 +0200)]
Added Utils::StringRef

Change-Id: I3d22ffe5ab2b3ec6ed1e93bc645dd7efec7e5dfe

5 years agoRenamed _TI_UTILS_DEBUG_PLAIN_ASSERT to _TI_UTILS_PLAIN_ASSERT
Daniel Levin [Tue, 14 Feb 2012 22:23:13 +0000 (00:23 +0200)]
Renamed _TI_UTILS_DEBUG_PLAIN_ASSERT to _TI_UTILS_PLAIN_ASSERT

5 years agoAdded TI_UTILS_UNUSED(x) macro
Daniel Levin [Mon, 13 Feb 2012 19:59:40 +0000 (21:59 +0200)]
Added TI_UTILS_UNUSED(x) macro

Change-Id: Id2db581e89d6dadc51b814ee60ff4ad6f0e416ce

5 years agoAdded logging KeyedVector
Daniel Levin [Mon, 13 Feb 2012 19:59:54 +0000 (21:59 +0200)]
Added logging KeyedVector

Change-Id: I970c4bcb1da073acd8c79adc8fb07c4f7d66f959

5 years agoAdded logging to android::Vector template
Daniel Levin [Mon, 13 Feb 2012 19:42:59 +0000 (21:42 +0200)]
Added logging to android::Vector template

Change-Id: Ie21f63bd6e5395e29befad19a2e4a4820fa6d57f

5 years agoAccept variable number of arguments for Log::format()
Daniel Levin [Tue, 14 Feb 2012 08:41:57 +0000 (10:41 +0200)]
Accept variable number of arguments for Log::format()

Rewritten Log::format() manipulator to have the same semantics as
printf(), accepting any number of arguments.

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoStreaming logging
Daniel Levin [Sat, 10 Dec 2011 23:31:41 +0000 (17:31 -0600)]
Streaming logging

Added Utils::Log class for streaming logging.

Streaming logging is much more powerful facility to log messages
comparing to old printf style.

It is type safe. Accidental mistakes with mismatched argument
format is not the case for the streaming operators.

It is fast. All operations could be inlined and optimized for
concrete logging type. No memory reallocations during formatting
message string, Log class operates on stack buffer.

It is flexible. Any type can be added as argument for the
inclusion operator << via template specializing. Message format
can be tuned for particular types.

Next modificators are allowed for Log class:
- Log::Space       - enabled automatically adding spaces between
                     tokens
- Log::NoSpace     - opposite to Log::Space
- Log::SpaceOnce   - adds single space delimiter
- Log::NoSpaceOnce - removes last space delimiter
- Log::Hex         - print value in hexademical mode, optionally
                   - with aligning leading zeros
- Log::Squared     - put value into brackets []
- Log::Format      - format integer value using printf style

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoType safe size of array
Daniel Levin [Fri, 23 Dec 2011 15:24:43 +0000 (09:24 -0600)]
Type safe size of array

Added template based size of array function Utils::sizeOfArray()
to replace old fashion approach to obtain size of static array
using macros. The template based function return result as int and
has protection at compile time to verify that passed value is not
pointer to array but array itself.

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoplain assert
Daniel Levin [Tue, 28 Feb 2012 09:32:06 +0000 (11:32 +0200)]
plain assert

5 years agoAdded Assert.h
Daniel Levin [Tue, 28 Feb 2012 09:07:36 +0000 (11:07 +0200)]
Added Assert.h

5 years agoAdded separate option to enable sensor debugging
Daniel Levin [Fri, 9 Dec 2011 16:17:05 +0000 (10:17 -0600)]
Added separate option to enable sensor debugging

5 years agoAdded separate options to enable MessageQueue debugging
Daniel Levin [Fri, 9 Dec 2011 15:51:10 +0000 (09:51 -0600)]
Added separate options to enable MessageQueue debugging

5 years agoAdded geometry types: Point, Size and Rect
Daniel Levin [Sun, 11 Dec 2011 18:41:56 +0000 (12:41 -0600)]
Added geometry types: Point, Size and Rect

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoRemoved using namespace android
Daniel Levin [Sun, 11 Dec 2011 18:39:55 +0000 (12:39 -0600)]
Removed using namespace android

No 'using namespace android' allowed anymore.

All Android types should be accessed with android::
namespace prefixed explicitly.

Change-Id: I17636288f194c323aa93f163f8b36e9da2140555
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoPower & Performance Measurement
Daniel Levin [Sun, 11 Dec 2011 18:31:53 +0000 (12:31 -0600)]
Power & Performance Measurement

Moved PPM into separate sources:
Measurement.h and Measurement.cpp.

Moved option to enable/disable PPM printing
from Global.h header into Makefile variables.

To enable PPM next Makefile variables should be used:
- TI_OMAP4_CAMERAHAL_PPM - enables PPM printing if defined
                           (disabled by default)
- TI_OMAP4_CAMERAHAL_PPM_ABSOLUTE - enables absolute timestamp
                           printing if defined, otherwise does
                           print values from Device instantiation
                           (disabled by default)

Change-Id: I1ec34934de80eeda7d6338d8259c9af9aa91c5b0
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoMinor fixes in General3ASettings.h
Daniel Levin [Fri, 20 Jan 2012 17:30:18 +0000 (19:30 +0200)]
Minor fixes in General3ASettings.h

Change-Id: I3c9f91dd472b90bdb4898072489294eacf8d0d19

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoInitial refactoring
Daniel Levin [Sun, 11 Dec 2011 18:30:34 +0000 (12:30 -0600)]
Initial refactoring

Wrapped utils directory sources with Ti::Utils:: namespace.
Wrappes camera sources with Ti::Camera:: namespace.

Splittered CameraHal.h header into separate interface headers:
- Device.h
- DisplayAdapterInterface.h
- EventProvider.h
- FrameNotifierInterface.h
- FrameProvider.h
- MemoryManager.h
- Types.h

Created Global.h header that contains global definitions for
the whole Camera HAL sources:
- Android API level macros
- PPM macros
- logging and assert macroses
- custom status_t tokens
- int <-> pointer casting helpers

Created Ti::Utils::status_t class that behaves as safe
replacement for android::status_t type. Fixed all invalid
assignments from random numbers to status_t.

Implemented crossplatform interface for Camera HAL module
management in Module.h/Module.cpp sources. Done module
implementation for ICS mainline.

Implemented crossplatform interface for surface management
in Surface.h/Surface.cpp sources. Done surface implementation
for ICS mainline via preview_stream_ops_t interface.

Moved BaseCameraAdapter into adapters subdirectory, since
this is not a part of abstract interface, but implementation
details.

Change-Id: I93d5eaf6ddf44777d3cd8db7460ce89d8f9f9b3f

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoTake path to DOMX project from global variable
Daniel Levin [Sun, 11 Dec 2011 18:16:20 +0000 (12:16 -0600)]
Take path to DOMX project from global variable

DOMX path varies between pastries. Appropriate
external changes are required to define global
Makefile variable TI_OMAP4_DOMX_PATH in
device/ti/<platform>/BoardConfig.mk per each
pastry.

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoCameraHAL: Improved debug logging
Daniel Levin [Sun, 11 Dec 2011 18:11:45 +0000 (12:11 -0600)]
CameraHAL: Improved debug logging

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_OMAP4_CAMERAHAL_DEBUG := 1

To enable verbose debug logging next variable should be put
into $AFS/buildspec.mk:
TI_OMAP4_CAMERAHAL_DEBUG_VERBOSE := 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.

To enable function logging next variable should be put into
$AFS/buildspec.mk:
TI_OMAP4_CAMERAHAL_UTILS_DEBUG_FUNCTION_NAMES := 1

3. Added optional printing message timestamps.

To enable timestamp printing next variable should be put into
$AFS/buildspec.mk:
TI_OMAP4_CAMERAHAL_UTILS_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.

Change-Id: I3e8114d948d7ae639c4634fa5b3bd5b857d65270
Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoPorting to Tuna
Daniel Levin [Tue, 24 Jan 2012 11:04:14 +0000 (13:04 +0200)]
Porting to Tuna

Various changes to make source compatible with current ICS release
for Tuna device. Changes are mostly DOMX headers compatibility
related.

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoUnified Camera HAL initial fork
Daniel Levin [Sun, 11 Dec 2011 18:10:48 +0000 (12:10 -0600)]
Unified Camera HAL initial fork

Removed everything except Camera HAL sources.

Relayout of source code:

- Android.mk  - build script
+ includes/   - public interfaces
+ src/        - common sources
  + utils/    - utility helper sources (debugging, message queue, etc)
  + 3rdparty/ - external helpers (NV12_resize)
  + adapters/ - camera adapters
    + v4l/    - V4LCameraAdapter
    + omx/    - OMXCameraAdapter

No code changes.

Signed-off-by: Daniel Levin <dendy@ti.com>
5 years agoCameraHal: Corrects image port configuration
Emilian Peev [Wed, 29 Feb 2012 07:01:52 +0000 (09:01 +0200)]
CameraHal: Corrects image port configuration

- Configuration of the image port was done
  using the port parameters for the video port.

Change-Id: Id7972437705a51434c77f4abdc79e433791a7520
Signed-off-by: Emilian Peev <epeev@mm-sol.com>
5 years agoCameraHAL: Fixed possible OMX flush failure
Daniel Levin [Sat, 25 Feb 2012 00:32:56 +0000 (02:32 +0200)]
CameraHAL: Fixed possible OMX flush failure

In case OMXCallbackHandler thread is not fast to catch passed
messages before OMXCameraAdapter calls flush() - the mIsProcessed
flag will remain set and flush() will return without waiting.

The mIsProcessed flag must be unset before putting message
into queue.

Signed-off-by: Daniel Levin <dendy@ti.com>
Change-Id: I11c14ccdad4e7bdc5828f7307af17e861b24cd3c

5 years agoCameraHAL: Stop Bracketing fix
Pavel Nedev [Thu, 23 Feb 2012 12:00:23 +0000 (14:00 +0200)]
CameraHAL: Stop Bracketing fix

Check if bracketing is currently running before stopping it.

Change-Id: I562f64f30d2f229e55bd78be1c184d65c838e2f6
Signed-off-by: Pavel Nedev <pnedev@mm-sol.com>
5 years agoCameraHAL: Proper isSupported param checking
Pavel Nedev [Tue, 28 Feb 2012 10:18:29 +0000 (12:18 +0200)]
CameraHAL: Proper isSupported param checking

isParameterValid() function implementation changed.
If supported parameters were 30,15,10 for example and the checked param was 5 previous implementation would return true
because strstr() would find 5 in 30,15,10.
Now each supported entry is first derived and then it is checked against the param to be set.

Code style also fixed.

Change-Id: I37d700833934c1c01685ccef962d26bcace078bf
Signed-off-by: Pavel Nedev <pnedev@mm-sol.com>
5 years agoCameraHAL: Removed duplicated insertion of KEY_FLASH_MODE
Daniel Levin [Tue, 28 Feb 2012 15:02:20 +0000 (17:02 +0200)]
CameraHAL: Removed duplicated insertion of KEY_FLASH_MODE

Signed-off-by: Daniel Levin <dendy@ti.com>
Change-Id: I1240b8bfe955ae52a2b95c9de1c9b7eb4a46c6e6

5 years agoCameraHAL: VFR ranges fixes
Pavel Nedev [Fri, 24 Feb 2012 16:16:23 +0000 (18:16 +0200)]
CameraHAL: VFR ranges fixes

Supported VFR ranges gotten from Ducati and supported fixed FPS filled to be within those ranges.
Several unnecessary parameter keys removed.
FPS handling in CameraHAL fixed.

Added class FpsRange with sort() method that conforms Android
requirement about FPS ranges order:
- The list is sorted from small to large (first by maximum fps and then minimum fps).

Merged fixed FPS values into FPS ranges.
Made the last (maximum) of fixed and variable FPS ranges to be default.

Signed-off-by: Pavel Nedev <pnedev@mm-sol.com>
Signed-off-by: Daniel Levin <dendy@ti.com>
Change-Id: I634065fada4e3adc5a6bd7b2986a9b9caac661dc

5 years agoCameraHal: Implementation for CAF status callbacks
Pavel Nedev [Tue, 21 Feb 2012 14:49:55 +0000 (16:49 +0200)]
CameraHal: Implementation for CAF status callbacks

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>
5 years agoMerge "CameraHAL: Mutually exclusive execution of stopImageCapture/startImageCapture...
Jean Johnson [Fri, 24 Feb 2012 22:05:18 +0000 (16:05 -0600)]
Merge "CameraHAL: Mutually exclusive execution of stopImageCapture/startImageCapture" into p-ics-mr1

5 years agoMerge "CameraHAL: Default framerate fix" into p-ics-mr1
Jean Johnson [Fri, 24 Feb 2012 21:30:10 +0000 (15:30 -0600)]
Merge "CameraHAL: Default framerate fix" into p-ics-mr1

5 years agoMerge "CameraHal: Fix for restoring video mode" into p-ics-mr1
Jean Johnson [Fri, 24 Feb 2012 21:22:50 +0000 (15:22 -0600)]
Merge "CameraHal: Fix for restoring video mode" into p-ics-mr1

5 years agoCameraHal: VFR updates
Emilian Peev [Mon, 20 Feb 2012 11:50:17 +0000 (13:50 +0200)]
CameraHal: VFR updates

- Changing the preview port definition will
  internally reset the VFR configuration.
  An additional call to 'setVFramerate()' is
  needed in order the restore the previously
  configured range after the preview port
  gets set.

Change-Id: I8b88863a9138e454e1489a0980bf875b91a295ad
Signed-off-by: Emilian Peev <epeev@mm-sol.com>
5 years agoCameraHAL: Mutually exclusive execution of stopImageCapture/startImageCapture
Andriy Chepurnyy [Thu, 16 Feb 2012 14:07:07 +0000 (16:07 +0200)]
CameraHAL: Mutually exclusive execution of stopImageCapture/startImageCapture

stopImageCapture/startImageCapture can be run from different
threads, sometimes it leds to race condition like - shutter
callback disabled right after it enable so startImageCapture
continuosly waits on mStartCaptureSem.WaitTimeout(OMX_CAPTURE_TIMEOUT)
and exit with invalid state. This patch is possible solution
for DR OMAPS00261663.

Change-Id: Idc8b0456a246a6aab1a86b5686720e41c681d26b
Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
5 years agoCameraHAL: Default framerate fix
Pavel Nedev [Thu, 23 Feb 2012 13:38:27 +0000 (15:38 +0200)]
CameraHAL: Default framerate fix

The default frame rate is now matched against the supported frame rates by the camera.
If the default value is supported it is set. The max supported value is used as default setting otherwise.

Change-Id: I8b99dc72a596b2cad66cb5638dca5d37c49369a2
Signed-off-by: Pavel Nedev <pnedev@mm-sol.com>
5 years agoCameraHal: Fix for restoring video mode
Dejan Ivanovski [Wed, 22 Feb 2012 16:26:01 +0000 (18:26 +0200)]
CameraHal: Fix for restoring video mode

Restore capture mode after recording video

Change-Id: Ic1236a0261384687a4a6c78dbcc5e7f8c552b4e3
Signed-off-by: Dejan Ivanovski <x0162121@ti.com>
5 years agoMerge "CameraHAL: Supported VFR fixes" into p-ics-mr1
Vicky Martinez-DeFrain [Wed, 22 Feb 2012 22:31:36 +0000 (16:31 -0600)]
Merge "CameraHAL: Supported VFR fixes" into p-ics-mr1

5 years agoCameraTest: Fix the default parameters
Dejan Ivanovski [Tue, 21 Feb 2012 08:30:22 +0000 (10:30 +0200)]
CameraTest: Fix the default parameters

The default values for some parameters are
now set to 0 to avoid situations when the
size of the array is smaller than the default index

Change-Id: If116f0012bbb17ecfac3f1b00c542c9fce0ace78
Signed-off-by: Dejan Ivanovski <x0162121@ti.com>
5 years agohwc: Add some functions to aid debug of Post2() api
Tony Lofthouse [Tue, 14 Feb 2012 21:38:46 +0000 (15:38 -0600)]
hwc: Add some functions to aid debug of Post2() api

Change-Id: Idcd3af9127b055779357f8dacb085aab8dbba385
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
5 years agoCameraHAL: Supported VFR fixes
Pavel Nedev [Tue, 21 Feb 2012 12:35:16 +0000 (14:35 +0200)]
CameraHAL: Supported VFR fixes

Supported variable frame rates are now gotten directly from Ducati as
min,max pairs.

Change-Id: I50a3045224b63c10d07e2cc9f0a939b6854f3004
Signed-off-by: Pavel Nedev <pnedev@mm-sol.com>
5 years agoMerge "hwc: changes for blit framebuffers" into p-ics-mr1
Jean Johnson [Tue, 21 Feb 2012 01:53:38 +0000 (19:53 -0600)]
Merge "hwc: changes for blit framebuffers" into p-ics-mr1