summaryrefslogtreecommitdiffstats
path: root/camera/inc
diff options
context:
space:
mode:
authorAndriy Chepurnyy <x0155536@ti.com>2012-10-26 14:02:25 +0300
committerDaniel Levin <dendy@ti.com>2012-11-26 20:17:15 +0200
commit5be19d85932b7efd58885bf4ca1934f52beb32c0 (patch)
tree671d0e83fb4de8278ac1eadc0d578cf97b5aee7c /camera/inc
parente54099214a3a1c340f4785c9e4d46265cecbfb49 (diff)
downloadhardware_ti_omap4-5be19d85932b7efd58885bf4ca1934f52beb32c0.zip
hardware_ti_omap4-5be19d85932b7efd58885bf4ca1934f52beb32c0.tar.gz
hardware_ti_omap4-5be19d85932b7efd58885bf4ca1934f52beb32c0.tar.bz2
CameraHAL: Make graphic buffer locking conditional
This mechanism is added to support components where locking mechanism is handled on DOMX layer. As example is using ducati decoder with buffers allocated via ANativeWindowDisplayAdapter. Change-Id: I33ae0f0766473a6d8e85699c31dcad9345b4df70 Signed-off-by: Andriy Chepurnyy <x0155536@ti.com>
Diffstat (limited to 'camera/inc')
-rw-r--r--camera/inc/ANativeWindowDisplayAdapter.h7
-rw-r--r--camera/inc/CameraHal.h10
2 files changed, 17 insertions, 0 deletions
diff --git a/camera/inc/ANativeWindowDisplayAdapter.h b/camera/inc/ANativeWindowDisplayAdapter.h
index 560e98d..eba91bb 100644
--- a/camera/inc/ANativeWindowDisplayAdapter.h
+++ b/camera/inc/ANativeWindowDisplayAdapter.h
@@ -86,6 +86,9 @@ public:
virtual status_t maxQueueableBuffers(unsigned int& queueable);
virtual status_t minUndequeueableBuffers(int& unqueueable);
+ // If set to true ANativeWindowDisplayAdapter will not lock/unlock graphic buffers
+ void setExternalLocking(bool extBuffLocking);
+
///Class specific functions
static void frameCallbackRelay(CameraFrame* caFrame);
void frameCallback(CameraFrame* caFrame);
@@ -173,6 +176,10 @@ private:
const char *mPixelFormat;
+ //In case if we ,as example, using out buffers in Ducati Decoder
+ //DOMX will handle lock/unlock of graphic buffers
+ bool mUseExternalBufferLocking;
+
#if PPM_INSTRUMENTATION || PPM_INSTRUMENTATION_ABS
//Used for calculating standby to first shot
struct timeval mStandbyToShot;
diff --git a/camera/inc/CameraHal.h b/camera/inc/CameraHal.h
index a97ae96..e5e6fdf 100644
--- a/camera/inc/CameraHal.h
+++ b/camera/inc/CameraHal.h
@@ -725,6 +725,7 @@ public:
void setVideoRes(int width, int height);
void flushEventQueue();
+ void setExternalLocking(bool extBuffLocking);
//Internal class definitions
class NotificationThread : public android::Thread {
@@ -760,6 +761,8 @@ private:
void copyAndSendPreviewFrame(CameraFrame* frame, int32_t msgType);
size_t calculateBufferSize(size_t width, size_t height, const char *pixelFormat);
const char* getContstantForPixelFormat(const char *pixelFormat);
+ void lockBufferAndUpdatePtrs(CameraFrame* frame);
+ void unlockBufferAndUpdatePtrs(CameraFrame* frame);
private:
mutable android::Mutex mLock;
@@ -815,6 +818,8 @@ private:
int mVideoWidth;
int mVideoHeight;
+ bool mExternalLocking;
+
};
@@ -1242,6 +1247,9 @@ public:
status_t storeMetaDataInBuffers(bool enable);
+ // Use external locking for graphic buffers
+ void setExternalLocking(bool extBuffLocking);
+
//@}
/*--------------------Internal Member functions - Public---------------------------------*/
@@ -1504,6 +1512,8 @@ private:
int mVideoHeight;
android::String8 mCapModeBackup;
+
+ bool mExternalLocking;
};
} // namespace Camera