summaryrefslogtreecommitdiffstats
path: root/camera/inc/ANativeWindowDisplayAdapter.h
diff options
context:
space:
mode:
authorTyler Luu <tluu@ti.com>2012-03-23 18:50:39 -0500
committerDaniel Levin <dendy@ti.com>2012-07-25 08:55:45 -0500
commit1f54112f1355b1298fa81b1f0ebf42d9f72cc87c (patch)
treeec4c8a5d961f9e2a1d0b0a7aafd2f66708ef5e51 /camera/inc/ANativeWindowDisplayAdapter.h
parent414aec6cd52af37f4a4e42dcfbdbe567190f62d6 (diff)
downloadhardware_ti_omap4-1f54112f1355b1298fa81b1f0ebf42d9f72cc87c.tar.gz
hardware_ti_omap4-1f54112f1355b1298fa81b1f0ebf42d9f72cc87c.tar.bz2
hardware_ti_omap4-1f54112f1355b1298fa81b1f0ebf42d9f72cc87c.zip
CameraHal: Add CameraBuffer (major refactoring)
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>
Diffstat (limited to 'camera/inc/ANativeWindowDisplayAdapter.h')
-rw-r--r--camera/inc/ANativeWindowDisplayAdapter.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/camera/inc/ANativeWindowDisplayAdapter.h b/camera/inc/ANativeWindowDisplayAdapter.h
index 2163d7b..ae3d7d7 100644
--- a/camera/inc/ANativeWindowDisplayAdapter.h
+++ b/camera/inc/ANativeWindowDisplayAdapter.h
@@ -36,7 +36,7 @@ public:
typedef struct
{
- void *mBuffer;
+ CameraBuffer *mBuffer;
void *mUser;
int mOffset;
int mWidth;
@@ -77,14 +77,13 @@ public:
#endif
- virtual int useBuffers(void* bufArr, int num);
virtual bool supportsExternalBuffering();
//Implementation of inherited interfaces
- virtual void* allocateBuffer(int width, int height, const char* format, int &bytes, int numBufs);
+ virtual CameraBuffer * allocateBufferList(int width, int height, const char* format, int &bytes, int numBufs);
virtual uint32_t * getOffsets() ;
virtual int getFd() ;
- virtual int freeBuffer(void* buf);
+ virtual int freeBufferList(CameraBuffer * buflist);
virtual int maxQueueableBuffers(unsigned int& queueable);
@@ -156,11 +155,12 @@ private:
mutable Mutex mLock;
bool mDisplayEnabled;
int mBufferCount;
- buffer_handle_t** mBufferHandleMap;
- IMG_native_handle_t** mGrallocHandleMap;
- uint32_t* mOffsetsMap;
+ CameraBuffer *mBuffers;
+ //buffer_handle_t** mBufferHandleMap; // -> frames[i].BufferHandle
+ //IMG_native_handle_t** mGrallocHandleMap; // -> frames[i].GrallocHandle
+ uint32_t* mOffsetsMap; // -> frames[i].Offset
int mFD;
- KeyedVector<int, int> mFramesWithCameraAdapterMap;
+ KeyedVector<buffer_handle_t *, int> mFramesWithCameraAdapterMap;
sp<ErrorNotifier> mErrorNotifier;
uint32_t mFrameWidth;