Added safe operations for OMX structs
authorDaniel Levin <dendy@ti.com>
Tue, 24 Jan 2012 16:00:17 +0000 (18:00 +0200)
committerDaniel Levin <dendy@ti.com>
Thu, 1 Mar 2012 08:54:37 +0000 (10:54 +0200)
commit459b2db8c3fbb5d2cfe581d0b84229815603bae8
tree5ca49b3acc96dadf916311be9106027e07b36998
parenta677023feb012adae6a3e5bd5bf1950656daa0c2
Added safe operations for OMX structs

Added template wrapper class OmxStruct that is supposed to replace
existing OMX structures. The wrapper does support RAII approach by
introducing default constructor with proper clearing OMX structure
and initializing version fields.

Clearing existing OmxStruct instance is done via assigning it to
default constructor.

Using default OMX structs without OmxStruct wrapper will cause error
at compile time for safety reasons.

Also refactored findExtraData() method to throw error at compile time
when attempting to cast found data to invalid OMX type. Allowed pairs
OMX_EXTRADATATYPE and OMX_OTHER_EXTRADATATYPE should be listed
explicitly in OmxTools.h header using CAMERAHAL_DECLARE_OMX_EXTRA_DATA
macro.

Also added global function globalOmxVersion() to return populated
OMX_VERSIONTYPE instance with Camera HAL version values.

Signed-off-by: Daniel Levin <dendy@ti.com>
Change-Id: Ia9fb0c3bf4aaeb1d4617184d96f7beb4352f744a
13 files changed:
src/adapters/omx/OMX3A.cpp
src/adapters/omx/OMXAlgo.cpp
src/adapters/omx/OMXCameraAdapter.cpp
src/adapters/omx/OMXCameraAdapter.h
src/adapters/omx/OMXCapabilities.cpp
src/adapters/omx/OMXCapture.cpp
src/adapters/omx/OMXDccDataSave.cpp
src/adapters/omx/OMXExif.cpp
src/adapters/omx/OMXFD.cpp
src/adapters/omx/OMXFocus.cpp
src/adapters/omx/OMXZoom.cpp
src/adapters/omx/OmxTools.cpp
src/adapters/omx/OmxTools.h